thank you for your reply
I added try/catch code but I got no exception
and it still doesn't send a email ;(

        try
        {
            _context.startActivity(i);
            Log.d(LOG_TAG, "startActivity() called");
        } catch (Exception e)
        {
            e.printStackTrace();
        }

below is my logcat log

WARN/dalvikvm(582): threadid=3: thread exiting with uncaught exception
(group=0x4001b188)
DEBUG/ErrorReporter(582): uncaughtException() tThread[main,5,main],
except:java.lang.RuntimeException: Unable to create service
com.my.service: java.lang.NullPointerException
INFO/ActivityManager(53): Starting activity: Intent
{ act=android.intent.action.CHOOSER flg=0x10000000 cmp=android/
com.android.internal.app.ChooserActivity (has extras) }
DEBUG/ErrorReporter(582): startActivity() called
ERROR/AndroidRuntime(582): Uncaught handler: thread main exiting due
to uncaught exception
ERROR/AndroidRuntime(582): java.lang.RuntimeException: Unable to
create service com.my.service: java.lang.NullPointerException
ERROR/AndroidRuntime(582):     at
android.app.ActivityThread.handleCreateService(ActivityThread.java:
2790)
ERROR/AndroidRuntime(582):     at android.app.ActivityThread.access
$3200(ActivityThread.java:119)
ERROR/AndroidRuntime(582):     at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1917)
ERROR/AndroidRuntime(582):     at
android.os.Handler.dispatchMessage(Handler.java:99)
ERROR/AndroidRuntime(582):     at android.os.Looper.loop(Looper.java:
123)
ERROR/AndroidRuntime(582):     at
android.app.ActivityThread.main(ActivityThread.java:4363)
ERROR/AndroidRuntime(582):     at
java.lang.reflect.Method.invokeNative(Native Method)
ERROR/AndroidRuntime(582):     at
java.lang.reflect.Method.invoke(Method.java:521)
ERROR/AndroidRuntime(582):     at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
ERROR/AndroidRuntime(582):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
ERROR/AndroidRuntime(582):     at
dalvik.system.NativeStart.main(Native Method)
ERROR/AndroidRuntime(582): Caused by: java.lang.NullPointerException
ERROR/AndroidRuntime(582):     at
com.my.service.onCreate(ISPService.java:230)
ERROR/AndroidRuntime(582):     at
android.app.ActivityThread.handleCreateService(ActivityThread.java:
2780)
ERROR/AndroidRuntime(582):     ... 10 more
INFO/Process(53): Sending signal. PID: 582 SIG: 3
INFO/dalvikvm(582): threadid=7: reacting to signal 3
INFO/dalvikvm(582): Wrote stack trace to '/data/anr/traces.txt'

I can't know why.

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