1

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

Kishore
  • 161
  • 1
  • 3
  • 6
  • if (!isTaskRoot()) { finish(); return; }Add this code in oncreate() method of Splashscreen acitivity it worked fine on all devices – Kishore Jul 05 '12 at 06:50

2 Answers2

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.

David Wasser
  • 93,459
  • 16
  • 209
  • 274
0

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

Community
  • 1
  • 1
Jaldip Katre
  • 3,216
  • 1
  • 19
  • 14