Custom Action Intent Opens my application in the same context as the application I clicked on.

I searched a lot about this.

But I have my code that works to open my application using the destination URL. This URL is usually delivered via email.

When I click on the link, it opens my application and everything seems to work; however, it opens in the context of an email application.

For example, if I click on the Gmail link when I open multitasking, I have to click on Gmail to go back to the application that was just opened.

I would have thought that he should open my application, and I can continue to use Gmail while my other application is running.

Any thoughts on this?

+3
source share
3

URL- :

intent:#Intent;launchFlags=0x10000000;component=com.mycompany.myapp/com.mycompany.myapp.MyActivity;end

URL- startFlag Intent.FLAG_ACTIVIY_NEW_TASK, ( - ).


EDIT: OP

, URL: http://com.my.app/5058749

Intent, Android , <intent-filter> <activity> . , , , , Activity, :

1) (, ), onCreate() super.onCreate():

if (!isTaskRoot()) {
    // Activity was launched into another task. Restart it in its own task
    Intent intent = new Intent(this, this.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(intent);
    finish();
    return;
}

2) singleTask ,

android:launchMode="singleTask"

<activity>. Activity , , , . , , , .

3) , , Intent, onCreate() ( Intent data URL- ). , , , 1 .

+4

Intent.FLAG_ACTIVITY_NEW_TASK Intent.FLAG_ACTIVITY_CLEAR_TOP (intent.SetFlags()). , .

0

android,

Intent.FLAG_ACTIVITY_NEW_TASK

Intent.FLAG_ACTIVITY_CLEAR_TOP

.

0

All Articles