Ok that's weird.
If you have nothing in your onStart and your onResume sets the loop as
running for your drawing loop, then that is where you should have a
look.
My guess would be that the restarting of your looping via setRunning
doesn't do what you think and that it is just not restarting at all so
that you don't have any drawing going on.
Or maybe you are creating objects in your onCreate method that get
destroyed when your apps looses focus and that are never recreated
again because onCreate is only called the very first time you launch
your activity.
First thing would be to Log.e("drawing","I'm drawing") in your thread
drawing loop.
Yahel
On Nov 30, 10:50 am, Eyvind Almqvist <[email protected]>
wrote:
> After I insert the USB cable, there is three options “1. Connect your
> phone. 2. Install PC Companion. 3. Charge phone.” No matter which
> option I have selected, the app will just freeze without any message.
>
> When I press the power key to go to power save mode and then press it
> again to resume the application, the app will just freeze without any
> message.
>
> I test by doing lots of screen orientation changes, like you
> recommended.But I can not replicate the freezing problem on my Samsung
> galaxy. I don't have the SonyEricsson X10 and X8 devices to test on. I
> try to simulate a power key press on the emulator, by pressing the
> power button. I debug and onKeyDown is called, but onpause() and
> onResume() is not called.
> Doesn't onpause() and onResume() get called when the power key is
> pressed? I can not simulate insertion of a USB cable on the emulator.
>
> My onStart method only call the superclass, so I don't see how an
> exception could be raised here. My onResume method also sets the
> graphics thread to setRunning(false), which means that the thread will
> continue, but it will not
> execute the drawing loop.
>
> On 29 Nov, 19:16, Dianne Hackborn <[email protected]> wrote:
>
>
>
>
>
>
>
> > What do you mean your "app freezes"? This is not a typical failure case
> > when pressing the power button. :}
>
> > On Mon, Nov 29, 2010 at 10:05 AM, Eyvind Almqvist <[email protected]
>
> > > wrote:
> > > My app freezes when the power key is pressed. This happens on
> > > SonyEricsson X10 and X8, but not on Samsung Galaxy S. This is what
> > > happens:
>
> > > 1)Launch the application->Press power key-> Press power key again to
> > > active app->App freeze.
>
> > > The app also freezes when the USB cable is inserted, like this:
>
> > > 2)Launch the application-> Insert USB cable->Message pops up and click
> > > any option to continue-> App freeze.
>
> > > I am distributing apps to SonyEricsson's Playnow appstore. They have
> > > reported this as error, so I have to fix this. Does anyone have an
> > > idea how to fix this? I have already followed all the advices in
> > > "Designing for Responsiveness" on
>
> > >http://developer.android.com/guide/practices/design/responsiveness.html
>
> > > --
> > > 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]<android-developers%2Bunsubs
> > > [email protected]>
> > > For more options, visit this group at
> > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> > Dianne Hackborn
> > Android framework engineer
> > [email protected]
>
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails. All such
> > questions should be posted on public forums, where I and others can see and
> > answer them.- Dölj citerad text -
>
> > - Visa citerad text -
--
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