Skip to content

Commit

Permalink
two fixes for very frequent crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
nobnago committed Feb 24, 2012
1 parent fc21d61 commit 63e5fa6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/com/ichi2/anki/StudyOptions.java
Expand Up @@ -632,7 +632,9 @@ protected void onCreate(Bundle savedInstanceState) {
Log.i(AnkiDroidApp.TAG, "StudyOptions - onCreate: Detected multiple instance of this activity, closing it and return to root activity");
Intent reloadIntent = new Intent(StudyOptions.this, StudyOptions.class);
reloadIntent.setAction(Intent.ACTION_MAIN);
reloadIntent.putExtras(getIntent().getExtras());
if (getIntent() != null && getIntent().getExtras() != null) {
reloadIntent.putExtras(getIntent().getExtras());
}
reloadIntent.addCategory(Intent.CATEGORY_LAUNCHER);
reloadIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
finish();
Expand Down Expand Up @@ -2785,6 +2787,11 @@ public void onPostExecute(Payload data) {
}
if (data.success) {
mCurrentDialogMessage = ((HashMap<String, String>) data.result).get("message");
Deck deck = DeckManager.getMainDeck();
if (deck == null) {
finish();
return;
}
DeckManager.getMainDeck().updateCutoff();
resetAndUpdateValuesFromDeck();
showDialog(DIALOG_SYNC_LOG);
Expand Down

0 comments on commit 63e5fa6

Please sign in to comment.