Thanks for the reply.

Actually Iam using fragment now for webview like you said.
But I call the Fragment/webview class from Oncreate() in an Activity
which extends FragmentActivity, which basically makes the purpose of
me using fragment useless as when orientation changes the the
Oncreate() restarts again creating new instance of Fragment/webview .

Iam using setRetainInstance(true) in the Fragment/Webview .

How can I make sure that, the webiview/Fragment does not get recreated
even when it's call from Oncreate() in the Activity is recreated
everytime when Orientation changes ?

Should I be using a onSaveInstanceState() and restorestate() in the
Fragment/webview class ?


On Jan 20, 3:19 am, Mark Murphy <mmur...@commonsware.com> wrote:
> Better yet would be to have the WebView in a dynamic fragment with
> setRetainInstance(true). Passing a widget between activity instances
> requires some patch-up work to avoid memory leaks -- you're better
> served letting existing Android code handle that.
>
>
>
>
>
>
>
>
>
> On Thu, Jan 19, 2012 at 5:15 PM, TreKing <treking...@gmail.com> wrote:
> > On Wed, Jan 18, 2012 at 11:07 AM, IndianDragon <developerdra...@gmail.com>
> > wrote:
>
> >> How to retain the form data in the webview after the change
> >> the orientation ?
>
> > Not sure if it's the best solution, but you could use
> > onRetainNonConfigurationInstance() to keep the same WebView instance alive
> > across Activity changes.
>
> > --------------------------------------------------------------------------- 
> > ----------------------
> > TreKing - Chicago transit tracking app for Android-powered devices
>
> > --
> > 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
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, One Low Price!

-- 
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