小编fad*_*wdt的帖子

无法在BroadcastReceiver SMS中实例化接收器

为什么我有这个错误:

ERROR/AndroidRuntime(854): Uncaught handler: thread main exiting due to uncaught exception
ERROR/AndroidRuntime(854): java.lang.RuntimeException: Unable to instantiate receiver com.android.GPS21.SmsReceiver: java.lang.ClassNotFoundException: com.android.GPS21.SmsReceiver in loader dalvik.system.PathClassLoader@43d02ef0
ERROR/AndroidRuntime(854): Caused by: java.lang.ClassNotFoundException: com.android.GPS21.SmsReceiver in loader dalvik.system.PathClassLoader@43d02ef0
Run Code Online (Sandbox Code Playgroud)

这是我的onReceive事件:

public void onReceive(Context context, Intent intent) {
  // TODO Auto-generated method stub
  Log.i(LOG_TAG, "Recieved a message");
  if (intent.getAction().equals(ACTION)) {
   // if(message starts with SMStretcher recognize BYTE)
   StringBuilder sb = new StringBuilder();

   // The SMS-Messages are 'hiding' within the extras of the Intent.
   Bundle bundle = intent.getExtras();
   if (bundle …
Run Code Online (Sandbox Code Playgroud)

sms android broadcastreceiver

9
推荐指数
2
解决办法
3万
查看次数

标签 统计

android ×1

broadcastreceiver ×1

sms ×1