call the default home screen from application

后端 未结 2 1909
死守一世寂寞
死守一世寂寞 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:19

    Hope this will do.

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

提交回复
热议问题