0

I have an activity which gets a page from the web and then parses it to a TableLayout that is inside a ScrollView.

Then I save the ScrollView into a global variable just like its described by Jeff Gilfelt in this post.

After this I leave my activity and enter it again and I check if there is a saved ScrollView in the global variable, and if there is I try to set it via setContentView().

The problem is that I get an IllegalStateException on the setContentView(savedScrollView); call.

Can anyone help me?

Community
  • 1
  • 1

1 Answers1

0

When activity is resumed, chances are good that it is still configured and does not need view setting. You shall set content view in onCreate() - not in onResume()

Konstantin Pribluda
  • 12,329
  • 1
  • 30
  • 35