call the default home screen from application

后端 未结 2 1911
死守一世寂寞
死守一世寂寞 2021-01-15 05:50

I need to call the default home screen that comes with my phone from my application which is also a home screen app. I\'ve tried searching and find this

             


        
2条回答
  •  无人共我
    2021-01-15 06:33

    you can just simple get the name and class from ResolveInfo and make intent manualy like for sonyercisson the package name is "com.sonyericsson.home" and class is "com.sonyericsson.home.HomeActivity"

       Intent intent = new Intent();
       intent.setClassName("com.sonyericsson.home", "com.sonyericsson.home.HomeActivity");
       intent.addCategory(Intent.CATEGORY_LAUNCHER);
       startActivity(intent);
    

    it works

提交回复
热议问题