Simple Notepad Application for Android OS
Révision | d95ca329cd14a843322f4102946da3283dd40b62 (tree) |
---|---|
l'heure | 2017-08-19 13:11:20 |
Auteur | Masahiko, SAWAI <say@user...> |
Commiter | Masahiko, SAWAI |
Fixed a bug that IllegalStatuException occur
Change transaction commit method.
* old - FragmentTransaction#commit()
* new - FragmentTransaction#commitAllowingStateLoss()
@@ -241,7 +241,7 @@ public class NoteDetailActivity extends Activity | ||
241 | 241 | editNoteFragment = new EditNoteFragment(); |
242 | 242 | FragmentTransaction ft = fm.beginTransaction(); |
243 | 243 | ft.replace(R.id.note_detail_container, editNoteFragment, FT_NOTE_EDIT); |
244 | - ft.commit(); | |
244 | + ft.commitAllowingStateLoss(); | |
245 | 245 | } |
246 | 246 | Log.d(LOG_TAG, "editNoteFragment => " + editNoteFragment); |
247 | 247 | Log.d(LOG_TAG, "editNoteFragment.noteUri => " + editNoteFragment.getNoteUri()); |
@@ -322,7 +322,7 @@ public class NoteDetailActivity extends Activity | ||
322 | 322 | deleteNoteFragment = new DeleteNoteFragment(); |
323 | 323 | FragmentTransaction ft = fm.beginTransaction(); |
324 | 324 | ft.replace(R.id.note_detail_container, deleteNoteFragment, FT_NOTE_DELETE); |
325 | - ft.commit(); | |
325 | + ft.commitAllowingStateLoss(); | |
326 | 326 | } |
327 | 327 | |
328 | 328 | Log.d(LOG_TAG, "Delete newNoteUri => " + newNoteUri); |
@@ -648,7 +648,7 @@ public class NotepadActivity extends Activity implements NotepadConstants, | ||
648 | 648 | FragmentTransaction ft = fm.beginTransaction(); |
649 | 649 | ft.add(R.id.note_detail_container, viewNoteFragment, FT_NOTE_DETAIL); |
650 | 650 | ft.addToBackStack(null); |
651 | - ft.commit(); | |
651 | + ft.commitAllowingStateLoss(); | |
652 | 652 | |
653 | 653 | viewNoteFragment.setNoteUri(noteUri); |
654 | 654 | } |