Messaging: Fix loader not auto-restarting
When suspending and resuming the app, somehow the loader returns immediately after onResume() with onLoadFinished() but somehow has no data left (data.moveToNext() returns false) which makes the conversation close immediately. Restarting the loader has the desired result: We can leave the app temporarily and come back to the same conversation again This also fixes adding a vcard attachment (since that temporarily leaves the app) Change-Id: Id52e55563a11474fa776323477aa900ca4be0bbe
This commit is contained in:
@@ -136,6 +136,15 @@ public class ConversationActivity extends BugleActionBarActivity
|
||||
mInstanceStateSaved = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRestart() {
|
||||
super.onRestart();
|
||||
final ConversationFragment conversationFragment = getConversationFragment();
|
||||
if (conversationFragment != null) {
|
||||
conversationFragment.onRestart();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
@@ -678,6 +678,10 @@ public class ConversationFragment extends Fragment implements ConversationDataLi
|
||||
mComposeMessageView.saveInputState(outState);
|
||||
}
|
||||
|
||||
public void onRestart() {
|
||||
mBinding.getData().restart(mBinding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
Reference in New Issue
Block a user