Call activity which is set as Home activity

664 views Asked by At

I have 2 activities. Inside the manifest activity 1 is set as Launcher and activity 2 is set as Home. Now i want to call the second activity from the first one to trigger the window for setting the home launcher and then the app should be selectable.

I have tried the following:

Intent selector = new Intent(this, homeActivity.class);
selector.addCategory(Intent.CATEGORY_HOME);
selector.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(selector);

But it seems not working.

Is this somehow possible? Do i need to change the Default activity?

1

There are 1 answers

0
Vova On

Try this :

selector.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK));