Commit 57314ddd authored by Alexandre Lision's avatar Alexandre Lision Committed by gerrit2
Browse files

ui: prevent screen duplication

During a call a user could launch a new Conversation screen over and
over again. At the end of the call to go back to the home screen he then
had to press back multiple times.
This patch prevent the Activity to be launched if it is already in the
current Task.

Change-Id: I9158b22efabe6c6210d622a96ca66863a4669e3d
Tuleap: #919
parent 56334ba4
......@@ -141,6 +141,12 @@ public class ConversationActivity extends AppCompatActivity implements
return 0;
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
refreshView(0);
}
private void refreshView(long refreshed) {
Pair<Conversation, SipUri> conv = getConversation(mService, getIntent());
mConversation = conv.first;
......
......@@ -53,7 +53,6 @@ import android.view.SurfaceView;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
......@@ -72,7 +71,6 @@ import butterknife.OnClick;
import cx.ring.R;
import cx.ring.adapters.ContactPictureTask;
import cx.ring.client.ConversationActivity;
import cx.ring.client.HomeActivity;
import cx.ring.interfaces.CallInterface;
import cx.ring.model.CallContact;
import cx.ring.model.Conference;
......@@ -411,9 +409,9 @@ public class CallFragment extends Fragment implements CallInterface {
Intent intent = new Intent()
.setClass(getActivity(), ConversationActivity.class)
.setAction(Intent.ACTION_VIEW)
.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_SINGLE_TOP)
.setData(Uri.withAppendedPath(ConversationActivity.CONTENT_URI, getFirstParticipant().getContact().getIds().get(0)));
intent.putExtra("resuming", true);
startActivityForResult(intent, HomeActivity.REQUEST_CODE_CONVERSATION);
startActivity(intent);
break;
case R.id.menuitem_addcontact:
startActivityForResult(getFirstParticipant().getContact().getAddNumberIntent(), ConversationActivity.REQ_ADD_CONTACT);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment