Hi again,

Hmm, it seems even more strange to me: the onDestroy() method of the top 
ListActivity is actually called very shortly after the search has 
triggered the onCreate()+onResume() methods that creates the second 
level ListActivity (note that this is the actual same class as the top 
one, just producing a different result due to the SEARCH action).
Call Sequence:

top onCreate()
top onResume()
-- I press search and enter some text.
top onPause()
2nd onCreate()
2nd onResume()
top onDestroy()
-- This is before the second ListActivity is even displayed

So obviously, by the time I press back in the 2nd ListActivity, there is 
no top ListActivity to show. So the problem is not the Back key, but 
that some unknown force has destroyed the top activity...

Note: the code is still compiled with android:minSdkVersion="2" and the 
very same package executes as expected on previous versions. So perhaps 
I've always done something incorrectly, but up until now the result was 
what I expected. In some special cases I do in fact explicitly call 
finish() to force this very effect, but that does not happen in this 
situation.

I didn't notice anything explicitly related to this in the release 
notes, but perhaps there is something between the lines that I have not 
yet realized.

                Advice appreciated / Jonas


Jonas Petersson wrote:
> Hi all,
> 
> I experience something slightly confusing in the 2.0 emulators (tried 
> several variants):
> 
> One of my apps is somewhat similar to Market in structure in that it is 
> a ListActivity that keeps creating new Intent(this, xxx.class); of 
> itself with various .putExtra(); that presents data in appropriate ways.
> In the Manifest there is also an intent-filter for action.SEARCH that 
> triggers onSearchRequested() and then onCreate() checks for 
> Intent.ACTION_SEARCH - pretty straight forward IMHO and it has also 
> worked exactly as intended up to and including 1.6 (where the new search 
> stuff seemed to integrate as expected).
> 
> However, in 2.0 I don't get back to the previous ListActivity when I 
> have used the search key to show something and then press the Back key. 
> The back key takes yet another step back.
> 
> Is this related to some other Back key issues I've seen mentioned here, 
> an intended new behaviour that I must handle differently in 2.0 or some 
> kind of bug that needs reporting. I don't have any kind if special key 
> listening going on at all.
> 
>                       Best / Jonas
> 
> PS. Lack of account handling and hardware to test Bluetooth on really 
> makes the emulation testing a pain - I'd love a Moto Droid over here. 
> Any suggestions as to how I can get my hands on one soon would be much 
> appreciated...
> 

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to