문제

There is a button in my app, when user clicks it, she will be leaded to the launcher interface.

I tried the following way:

Intent startMain = new Intent(Intent.ACTION_MAIN);
startMain.addCategory(Intent.CATEGORY_HOME);
startActivity(startMain);

But it goes to the "Home screen"(on the left), rather the "Launcher screen"(on the right).

I also tried Intent.CATEGORY_LAUNCHER, but it pops up a dialog for selecting an app to finish the action.

enter image description here

도움이 되었습니까?

해결책

How to go to the launcher where all the apps are listed?

You don't, unless perhaps you are the author of the home screen in question.

As Simon indicates, there is no requirement for any home screen to allow external apps to directly go to a separate "launcher". Not every home screen even has a separate "launcher" (some blend the app widgets and launcher icons in a single display).

You are welcome to contact the authors of various home screen implementations and see if they expose some special Intent structure that would take you to the launcher.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top