Wednesday, February 23, 2011

[android-developers] Re: App crashing with the exception View not attached to Window manager

Yes fernando. My activity is getting created at the time of
orientation change. and onPostExecute is getting called after activity
is destroyed. progress bar is independent dialog which is getting
dismiss at the time of onPostExecute. and if orientation has changed,
it is no more attached to the window manager. because of which my app
get crashed.

Please tell me what shud i mention in the manifest file. And what shud
i do in onConfigurationChanged? In my application onCreate is getting
called at the time of orientation chnage. Can it be stopped to
rereate? what should I take care or implement to stop it.

Thanks in advance
~Manish

On Feb 24, 12:00 pm, fernando <fernandoler...@gmail.com> wrote:
> It seems that your activity is being recreated on orientation changes
> because this configuration change is not declared on the manifest, and
> the post execute is called after the activity is destroyed. To check
> that, put log messages on the onCreate, onConfigurationChanged and
> onDestroy activity methods (you might need to override those functions
> and don't forget to call super implementation if so).
> Those logs along with the exception logging will say if the crash
> happened after the activity is destroyed and if it's been created
> multiple times to react to the orientation change. Hope it helps you
> investigating. Let us know
>
> - Fernando
>
> On Feb 23, 10:00 pm, TreKing <treking...@gmail.com> wrote:
>
>
>
> > On Tue, Feb 22, 2011 at 11:58 PM, Manish Garg <mannishga...@gmail.com>wrote:
>
> > > If user change the orientation at the time of fetching and onPostExecute
> > > get called after orientation change, my application is crashing.
>
> > Try this first.http://www.google.com/search?q=asynctask+orientation+change
>
> > --------------------------------------------------------------------------- ----------------------
> > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> > transit tracking app for Android-powered devices- Hide quoted text -
>
> - Show quoted text -

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment