1 message in com.googlegroups.android-beginnersRe: [android-beginners] Re: emulator ...
FromSent OnAttachments
Raul Bocter05 Feb 2008 13:15 
Subject:Re: [android-beginners] Re: emulator sometimes working, sometimes not
From:Raul Bocter (raul@gmail.com)
Date:02/05/2008 01:15:59 PM
List:com.googlegroups.android-beginners

I was looking for this email of mine, so I can reply to it. I could not see it in the big sea of emails :D. The problem was on my side, because I had a thread that tried to start the second activity before the current onCreate() was finished. I guess that the context (current activity) is not valid until onCreate() is done executing (and maybe more than that).

Thank you for your time, Raul

On Feb 5, 2008 9:29 PM, Megha <andr@gmail.com> wrote:

Hi,

Could you try executing one of the sample applications and tell us whether you are able to replicate this behavior while running sample code? Also, what OS are your using?

On Feb 1, 12:47 pm, "Raul Bocter" <raul@gmail.com> wrote:

Hello all,

I tried today to start a new activity from the main activity. It took me a few hours because I never knew if I did something wrong or the emulator does. It seems that the code does not run always the same way. After my actvity first started, I ran the application again and it throwed an exception. With no modifications in the code. I tried several times to run the app and sometimes it runs ok and sometimes throws this exception:

E/AndroidRuntime(634): Uncaught handler: thread Thread-6 exiting due to uncaught exception E/AndroidRuntime(634): java.lang.RuntimeException: Not supported in system context E/AndroidRuntime(634): at android.app.ApplicationContext.getPackageName( ApplicationContext.java:235) E/AndroidRuntime(634): at android.content.ComponentName.<init>( ComponentName.java:72) E/AndroidRuntime(634): at android.content.Intent.<init>(Intent.java :1241)

Why does this happen ? I guess it is a bug in the emulator. Is there a solution / workaround for this ?

Thanks, Raul

PS: I am not inserting code here because, considerring that sometimes it works fine, the code is ok. Though, it might be useful to mention that I use the Intent(Context, Class) constructor.