I have a project for HoneyComb and I get an error after use recreate() method at onResum() method in my main Activity.
11-10 22:05:42.090: E/ActivityThread(1917)
You should never be calling onPause onCreate onResume
etc on your own. You shouldn't need to use recreate()
for what you want to do, put initialisation code elsewhere if it needs updating. Further, use an integer to store the state of the program instead of a string, then declare some final variables to reference e.g.
public final int RECREATE_ON = 1;
public final int RECREATE_OFF = 2;
private int recreate = RECREATE_OFF;
...
if(recreate==RECREATE_ON){
recreate();
}
Remember what recreate() is doing:
Cause this Activity to be recreated with a new instance. This results in essentially the same flow as when the Activity is created due to a configuration change -- the current instance will go through its lifecycle to onDestroy() and a new instance then created after it.
This is why you are getting the onPause
message.