Problem:
Android: couldn't save which view has focus because the focused view ### has no ID
There are two possible causes:
Solution 1:
<Application
Android: icon = "@ drawable/icon" Android: Label = "@ string/app_name">
<Activity
Android: Label = "@ string/app_name"
Android: configchanges ="Orientation | keyboardhidden | keyboard | screenlayout"
Android: Name = ". Main">
<Intent-filter>
<Action Android: Name = "android. Intent. Action. Main"/>
<Category Android: Name = "android. Intent. Category. launcher"/>
</Intent-filter>
</Activity>
</Application>
Solution 2:
What probably happened is that you created a thread in the surfacecreated () method but didn't stop it or get rid of it in the surfacedestroy () method.
When you didn't give a theme for the preferences, it took over the whole screen and your old surface was destroyed. but when you specified a dialog-like theme, the old surface was still there because it was visible underneath the preferences.
Public void surfacecreated (surfaceholder holder)
{
If (_ thread = NULL| _ Thread. getstate () = thread. state. Terminated)
{
_ Thread = new tutorialthread (getholder (), this );
_ Thread. setrunning (true );
_ Thread. Start ();
}
Else
{
_ Thread. setrunning (true );
_ Thread. Start ();
}
}
This solved the problem for me, a thread's start method cannot be called twice, so I had to reallocate...
Http://forums.pragprog.com/forums/138/topics/4085