当用户在安装我的应用程序后第一次登录时发生此错误。但在下次发布时(用户已经登录)该应用程序正常工作。java.lang.SecurityException:无法在注册接收者时找到调用者android.app.ApplicationThreadProxy的应用程序android.content.IIntentReceiver
在我的应用程序中,我使用BroadcastReceiver
这是用于检查互联网连接。
因此,具体来说,该应用程序在注册BroadcastReceiver
的同时具有上述Exception
。任何帮助将非常明显!
我logcat的是像下面
java.lang.RuntimeException: Unable to resume activity {com.android.myproject/com.android.myproject.MapActivity}: java.lang.SecurityException: Unable to find app for caller [email protected] (pid=24211) when registering receiver [email protected]
1 at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2762)
2 at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2791)
3 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1288)
4 at android.os.Handler.dispatchMessage(Handler.java:99)
5 at android.os.Looper.loop(Looper.java:137)
6 at android.app.ActivityThread.main(ActivityThread.java:5095)
7 at java.lang.reflect.Method.invokeNative(Native Method)
8 at java.lang.reflect.Method.invoke(Method.java:511)
9 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:845)
10 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
11 at dalvik.system.NativeStart.main(Native Method)
12Caused by: java.lang.SecurityException: Unable to find app for caller [email protected] (pid=24211) when registering receiver [email protected]
13 at android.os.Parcel.readException(Parcel.java:1425)
14 at android.os.Parcel.readException(Parcel.java:1379)
15 at android.app.ActivityManagerProxy.registerReceiver(ActivityManagerNative.java:2228)
16 at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1356)
17 at android.app.ContextImpl.registerReceiver(ContextImpl.java:1324)
18 at android.app.ContextImpl.registerReceiver(ContextImpl.java:1318)
19 at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:423)
20 at com.android.myproject.MapActivity.onResumeOperations(MapActivity.java:584)
21 at com.android.myproject.MapActivity.onResume(MapActivity.java:618)
22 at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1185)
23 at android.app.Activity.performResume(Activity.java:5203)
24 at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2752)
为了澄清我的问题,我的onResumeOperations()
样子
public void onResumeOperations(){
if (!manager.isProviderEnabled(LocationManager.GPS_PROVIDER)&& !isFinishing()) {
ShowGpsDialog();
} else {
removeGpsDialog();
}
registerReceiver(internetConnectionReciever, new IntentFilter(
"android.net.conn.CONNECTIVITY_CHANGE"));
registerReceiver(GpsChangeReceiver, new IntentFilter(
LocationManager.PROVIDERS_CHANGED_ACTION));
isRecieverRegistered = true;
if (AndyUtils.isNetworkAvailable(this)
&& manager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
if (!isDataRecieved) {
checkStatus();
startLocationUpdateService();
// getPreReservations();
}
}
registerIsApproved();
startRepeatingChecker();
}
这onResumeOperations()
被称为onResume()
。正如我之前提到的,注册internetConnectionReceiver
时会出现问题。
可以共享logcat吗? – rafsanahmad007
请查看我编辑的问题 –
您可以发布您的'MapActivity.java:618'以及其他一些相关的代码吗? –