简体   繁体   English

使用 Android Studio 隐藏应用程序

[英]Using Android Studio Hiding an application

I have an Android Studio application that capture phone screen.我有一个捕获手机屏幕的 Android Studio 应用程序。 With on press of a button (start capturing), I would like to hide the main screen.按下按钮(开始捕获),我想隐藏主屏幕。 then when I want to finish I press the application icon and show the main screen again.然后当我想完成时,我按下应用程序图标并再次显示主屏幕。

Press home button Going to home screen programmatically按主页按钮以编程方式进入主屏幕

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM