Hi,

I've got the same issue, here's my code snapshot:

(code from the Activity that starts the service)

Bundle bundle = new Bundle();
bundle.putString("key1", val1);
bundle.putString("key2", val2);

Intent intent = new Intent(TheActivity.this, TheService.class);
intent.putExtras(bundle);
startService(intent);

(code from the service that throws the random NPE)

@Override
public void onStart(Intent intent, int startId) {
        super.onStart(intent, startId);
        bundle = intent.getExtras(); // throws random NPE
}

I've never gotten the NPE on my HTC Hero with Android 2.1 update1, but
I've received 13 crash reports in Market Developer Console, 10 from
OTHERS, 3 from Nexus One and 3 from Droid.

What is going on here?

//Anders

On Aug 12, 3:35 am, Alex Xin <xinxi...@gmail.com> wrote:
> Hi, Frank
>
> I can give it a try.
>
> Above code snapshot works perfect and on my Android 1.6 based phone, but
> random FC on Nexus One.
>
> Alex
>
>
>
> On Thu, Aug 12, 2010 at 9:26 AM, Frank Weiss <fewe...@gmail.com> wrote:
> > Does it FC when you use getIntent() instead of the parameter to onStart?
>
> > --
> > 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<android-developers%2Bunsubs 
> > cr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

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