Autoshow MainActivity after install

て烟熏妆下的殇ゞ 提交于 2019-12-11 19:45:59

问题


I have a question, is it possible to show MainActivity to user after they install my .apk on their devices? Because I have read that we can't autolaunch our apk after install, but I just need to show my Activity, so is it possible?


回答1:


You can't auto run your Android application right after the installation.

Maximum that you can do is to listen to android.intent.action.BOOT_COMPLETED intent, and it will work only if the user manually launch your application at least once.




回答2:


There is no way, you can start a services after installation but no to launch the app. Look this answare to learn more about the problem:

Autostart android app And this Launch services after installation



来源:https://stackoverflow.com/questions/17911412/autoshow-mainactivity-after-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!