Hello everyone,

here is a simple example that drives me crazy. I have been debugging
it for a few days now, with a limited success. If anyone can take a
look, and tell me what I am doing wrong, I would be deliriously
happy.

I have got a TabActivity, and in onCreate I do this:

LayoutInflater myInflater = LayoutInflater.from(appContext);
myListView = (ListView)myInflater.inflate(R.layout.list_layout, null);


Briefly, that's one tab with one list view. Whenever I have some new
data for my list, I do this:

myListView.setAdapter(new ArrayAdapter<SpannableString>(this,
R.layout.some_list_layout, listOfContacts));


This works nice. List of results is a list of contacts. If I launch
some other activity from the list (e.g. context menu -> send SMS), and
then return to my activity without any work, next time I call
setAdapter(), everything works fine.
BUT, if I launch some other activity (e.g. that particular message
compose screen), and while I am on that activity if I press any hard
key button (e.g. '2', 'A', 'B', etc), when I return back to my
activity, content will still be there, but next time I call:
myListView.setAdapter(new ArrayAdapter<SpannableString>(this,
R.layout.some_list_layout, listOfContacts));

the list view will be gone. I shall not see the content of the list
anymore.

What's that strange thing that happens if I press any hard key button
on some other activity?


Thank you in advance.

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

Reply via email to