on click of shortcut on homescreen launching from spalsh screen in android

我与影子孤独终老i 提交于 2019-12-01 11:43:38

问题


I reated configuration in mainfest file as follows

shortcut is created on homescreen, but the problem is when i click on this it is not retaining the state correctly, it is starting from splash screen. when i launch an app from all apps it is retaining the state correctly.

Myapp-->splashscreen-->Activity1-->Activity2-->click home-->click shortcuticon-->splashscreen

Myapp-->splashscreen-->Activity1-->Activity2-->click home-->-->click menu-->all apps-->click shortcuticon-->Activity2


回答1:


I'm going to assume that you started the app initially (the first time) from an IDE (like Eclipse or IntelliJ) or after installing it using the installer (from the market or browser or clicking on APK in file browser). If so, this is a known bug in Android (see http://code.google.com/p/android/issues/detail?id=26658 ). Many people have struggled for days chasing this problem :-(

A simple workaround for this problem can be found at http://code.google.com/p/android/issues/detail?id=2373#c21

To verify this is your problem, don't start it from the IDE or installer. Simply install the app and then go start it from the list of available applications.




回答2:


If the shortcut is created programmatically then your app wont resume because you have specified an activity for shortcut intent,

To solve this, have a look at the the answer here



来源:https://stackoverflow.com/questions/11296203/on-click-of-shortcut-on-homescreen-launching-from-spalsh-screen-in-android

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