Skip to content

Commit

Permalink
Wont exit app when back is pressed in the chat window
Browse files Browse the repository at this point in the history
  • Loading branch information
markwinter committed Sep 23, 2014
1 parent 55ad0bf commit 6e4784b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/src/main/java/im/tox/antox/activities/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@ public void onClick(DialogInterface dialog, int which) {

@Override
public void onBackPressed() {
finish();
if(pane.isDrawerOpen(Gravity.RIGHT))
pane.closeDrawers();
else
finish();
}

/* Needed for Tox ID dialog in settings fragment */
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/im/tox/antox/tox/ToxSingleton.java
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ public void sendUnsentMessages(Context ctx) {
Log.d(TAG, e.toString());
}
try {
if (friend != null) {
if (friend != null && friend.isOnline() && jTox != null) {
// TODO: fix for withid change
jTox.sendMessage(friend, unsentMessageList.get(i).message);
}
Expand Down

0 comments on commit 6e4784b

Please sign in to comment.