clear parent activities pending view intent before calling startAcitvityForResult()
This commit is contained in:
parent
febd9cc3e0
commit
b8474941c7
|
@ -902,7 +902,11 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
|
||||||
|
|
||||||
private void handleNegativeActivityResult(int requestCode) {
|
private void handleNegativeActivityResult(int requestCode) {
|
||||||
switch (requestCode) {
|
switch (requestCode) {
|
||||||
//nothing to do for now
|
case ATTACHMENT_CHOICE_TAKE_PHOTO:
|
||||||
|
if (pendingTakePhotoUri.clear()) {
|
||||||
|
Log.d(Config.LOGTAG,"cleared pending photo uri after negative activity result");
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1761,6 +1765,15 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void startActivityForResult(Intent intent, int requestCode) {
|
||||||
|
final Activity activity = getActivity();
|
||||||
|
if (activity instanceof ConversationsActivity) {
|
||||||
|
((ConversationsActivity) activity).clearPendingViewIntent();
|
||||||
|
}
|
||||||
|
super.startActivityForResult(intent, requestCode);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSaveInstanceState(Bundle outState) {
|
public void onSaveInstanceState(Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
|
@ -1872,6 +1885,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
|
||||||
public void reInit(Conversation conversation, Bundle extras) {
|
public void reInit(Conversation conversation, Bundle extras) {
|
||||||
QuickLoader.set(conversation.getUuid());
|
QuickLoader.set(conversation.getUuid());
|
||||||
this.saveMessageDraftStopAudioPlayer();
|
this.saveMessageDraftStopAudioPlayer();
|
||||||
|
this.clearPending();
|
||||||
if (this.reInit(conversation, extras != null)) {
|
if (this.reInit(conversation, extras != null)) {
|
||||||
if (extras != null) {
|
if (extras != null) {
|
||||||
processExtras(extras);
|
processExtras(extras);
|
||||||
|
@ -2662,11 +2676,13 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearPending() {
|
private void clearPending() {
|
||||||
if (postponedActivityResult.pop() != null) {
|
if (postponedActivityResult.clear()) {
|
||||||
Log.e(Config.LOGTAG, "cleared pending intent with unhandled result left");
|
Log.e(Config.LOGTAG, "cleared pending intent with unhandled result left");
|
||||||
}
|
}
|
||||||
pendingScrollState.pop();
|
if (pendingScrollState.clear()) {
|
||||||
if (pendingTakePhotoUri.pop() != null) {
|
Log.e(Config.LOGTAG,"cleared scroll state");
|
||||||
|
}
|
||||||
|
if (pendingTakePhotoUri.clear()) {
|
||||||
Log.e(Config.LOGTAG, "cleared pending photo uri");
|
Log.e(Config.LOGTAG, "cleared pending photo uri");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -46,4 +46,10 @@ public class PendingItem<T> {
|
||||||
public synchronized T peek() {
|
public synchronized T peek() {
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public synchronized boolean clear() {
|
||||||
|
boolean notNull = this.item != null;
|
||||||
|
this.item = null;
|
||||||
|
return notNull;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue