2012-02-16 2 views
0

내 응용 프로그램에서 홈 스크린을 어떻게 열어야합니까?Android : 내 애플리케이션에서 홈 화면을 어떻게 열어야합니까?

Intent i = new Intent(Intent.ACTION_MAIN); 
PackageManager manager = getPackageManager(); 
i = manager.getLaunchIntentForPackage("com.android.launcher"); 
startActivity(i); 

이 코드는 내가

com.android.browser 

을 열 때 작동하지만 문제가 무엇인지

com.android.launcher 

을 위해 일하고 밤은? 패키지 이름이나 다른 것?

도움이 될 것입니다.

+0

[프로그래밍 화면으로 간다]의 중복 가능성 (http://stackoverflow.com/questions/3724509/going-to-home-screen-programmatically) –

답변

0
ask the user to open any app 

Intent startMain = new Intent(Intent.ACTION_MAIN); 
startMain.addCategory(Intent.CATEGORY_LAUNCHER); 
startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
startActivity(startMain); 
관련 문제