Hi,
I 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 that throws random NPE in Service class)
@Override
public void onStart(Intent intent, int startId) {
super.onStart(intent, startId);
bundle = intent.getExtras(); // throws random NPE
}
I've never received the NPE on my HTC Hero with Android 2.1 update1,
but I've got 16 crash reports in the Developer Console, 10 from
OTHERS, 3 from Nexus One and 3 from Droid.
What is happening here?
Anders
On Aug 12, 3:35 am, Alex Xin <[email protected]> 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 <[email protected]> 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 [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
--
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