Great you figured that one out! :-)
On Jun 27, 9:12 pm, Bara bara.kath...@gmail.com wrote:
I figured it out! As it turns out, I have the ListView's visibility
set to GONE by default. I show the ListView in my OnClick event for
my button. When the orientation changes and the Activity gets
I figured it out! As it turns out, I have the ListView's visibility
set to GONE by default. I show the ListView in my OnClick event for
my button. When the orientation changes and the Activity gets
destroyed and re-created, the ListView's visibility gets reset to the
default set in the XML,
thisListView.setAdapter(r_adapter);
r_adapter.notifyDataSetChanged();
If you do 'setAdapter', calling notifyDataSetChanged() is not
necessary, if i'm not mistaken. But calling an extra
notifyDataSetChanged() should hurt.
Override the adapter's getItem and getCount methods and put a break-
point
You return an object that doesn't hold any permanent residence to an
activity, just a temporary one.
private final Runnable mUpdateDisplayRunnable = new Runnable() {
public void run() {
mData.getCurrentActivity().updateDisplay();
}
};
public void onCreate(...) {
...
mData =
I'm sorry, but I'm still not understanding what exactly I should be
holding a reference to. What should mData contain (or rather, what
are the properties in the MyRetainedData class)? I appreciate the
help immensely :)
Bara
On Jun 22, 10:23 am, Streets Of Boston flyingdutc...@gmail.com
wrote:
Classic problem!
Use a static variable rather than onRetainConfigurationChange() lot of state
data to be saved doesn't work all the time!!
Gyan
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
After some work, I implemented Streets of Boston's code but I am still
running into the same problem. I created a new class that holds an
instance of my activity. I then send this object using
OnRetainNonConfigurationInstance, and use it in my Runnable to call
UpdateDisplay() just like he did.
The call to onRetainConfigurationChange and
getLastNonConfigurationInstance always works, if you have your
activity declared not to handle configuration changes by itself (which
it doesn't by default).
On Jun 22, 10:51 am, Gyan gnanesh@gmail.com wrote:
Classic problem!
Use a static
Hmm... could it be my ArrayAdapter class causing the problem?
This is how I call it:
r_adapter = new ReminderAdapater(rData.getCurrentActivity(),
remindersList, thisListView);
thisListView.setAdapter(r_adapter);
r_adapter.notifyDataSetChanged();
And this is ReminderAdapater itself:
public
This probably happens because your runnable 'mUpdateDisplayRunnable'
has an implicit reference to 'this' activity that calls
'this.updateDisplay()' in its run() method.
When an orientation-change happens the current activity ('this') is
destroyed a brand-new activity is created. When the handler
Wait, what exactly should I be returning with
onRetainNonConfigurationInstance? Wouldn't anything I return with
that be from the original activity, not the new one? So wouldn't that
cause the same problem?
Bara
On Jun 21, 7:27 pm, Streets Of Boston flyingdutc...@gmail.com wrote:
This probably
11 matches
Mail list logo