On 11 Okt., 07:32, TreKing <[email protected]> wrote:
> Show the stack trace?

I think the reason is that there is no context at some point. Compare
this answer:
http://stackoverflow.com/questions/3888602/android-startservice-from-the-service-class-itself/3889237#3889237

Here is the stack trace, anyway:

Uncaught handler: thread main exiting due to uncaught exception
java.lang.NullPointerException
    at android.content.ContextWrapper.startService(ContextWrapper.java:
326)
    at
com.example.helloandroid.UnusualService.startService(UnusualService.java:
59)
    at com.example.helloandroid.HelloAndroid
$3.onClick(HelloAndroid.java:31)
    at android.view.View.performClick(View.java:2364)
    at android.view.View.onTouchEvent(View.java:4179)
    at android.widget.TextView.onTouchEvent(TextView.java:6541)
    at android.view.View.dispatchTouchEvent(View.java:3709)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
    at com.android.internal.policy.impl.PhoneWindow
$DecorView.superDispatchTouchEvent(PhoneWindow.java:1659)
    at
com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:
1107)
    at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
    at com.android.internal.policy.impl.PhoneWindow
$DecorView.dispatchTouchEvent(PhoneWindow.java:1643)
    at android.view.ViewRoot.handleMessage(ViewRoot.java:1691)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:123)
    at android.app.ActivityThread.main(ActivityThread.java:4363)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:521)
    at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
    at dalvik.system.NativeStart.main(Native Method)

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

Reply via email to