RuntimeException:接收广播Intent时出错 - package_changed

时间:2012-01-31 15:19:07

标签: android android-intent broadcastreceiver

我得到了这个运行时异常,但是记录器不是很有帮助,并且它没有指向代码中的任何特定位置。我认为其关键部分如下:

接收广播意图{act = android.intent.action.PACKAGE_CHANGED dat = package:com.google.android.apps.maps

出于:

01-31 15:05:38.647: INFO/ActivityThread(10213): Receiving broadcast android.intent.action.PACKAGE_CHANGED seq=-1 to android.app.ActivityThread$PackageInfo$ReceiverDispatcher@2fa54588

01-31 15:05:38.737: WARN/ResourceType(1128): Resources don't contain package for resource number 0x7f060001

01-31 15:05:38.787: WARN/ResourceType(10213): Failure getting entry for 0x7f090004 (t=8 e=4) in package 0: 0xffffffb5

01-31 15:05:38.797: ERROR/AndroidRuntime(10213): Uncaught handler: thread main exiting due to uncaught exception
01-31 15:05:38.797: ERROR/AndroidRuntime(10213): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.PACKAGE_CHANGED dat=package:com.google.android.apps.maps flg=0x20000000 (has extras) } in com.android.launcher2.LauncherModel@2fa12b48
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:780)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):
        at android.os.Handler.handleCallback(Handler.java:587)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at android.os.Handler.dispatchMessage(Handler.java:92)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at android.os.Looper.loop(Looper.java:123)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at android.app.ActivityThread.main(ActivityThread.java:4395)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at java.lang.reflect.Method.invokeNative(Native Method)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at java.lang.reflect.Method.invoke(Method.java:521)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at dalvik.system.NativeStart.main(Native Method)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f090004
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at android.content.res.Resources.getValue(Resources.java:891)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at android.content.res.Resources.getDimension(Resources.java:455)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at com.android.launcher2.Utilities$BubbleText.<init>(Utilities.java:438)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at com.android.launcher2.AllAppsList.updatePackage(AllAppsList.java:172)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at com.android.launcher2.LauncherModel.onReceive(LauncherModel.java:341)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
    at android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThread.java:769)
01-31 15:05:38.797: ERROR/AndroidRuntime(10213):     
... 9 more

现在,我的应用程序中至少没有使用Google地图。这是一个3D应用程序,只有一个外部意图,即语音输入/识别器,我使用以下三个功能

private void loadRecognizer(){
    // Check to see if a recognition activity is present
PackageManager pk = getPackageManager();
List<ResolveInfo> activities = pk.queryIntentActivities(
        new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);
if (activities.size() != 0) {
    gWorld.setSpokenText("Recognizer OK!");
} else {
    gWorld.setSpokenText("Recognizer not present!");
}

}


private void fireRecognizer(){

    Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
    intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
    //intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Speech recognition demo");
    startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);




}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data){

    if (requestCode == VOICE_RECOGNITION_REQUEST_CODE && resultCode == RESULT_OK){

        // Fill the list view with the strings the recognizer thought it could have heard
        matches = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);

        String listString = "";

        for (String s : matches)
        {
            listString += s + "\t";
        }


        gWorld.setSpokenText(listString);
        Logger.log(listString);

    }


    gWorld.speechActivity = false;
    super.onActivityResult(requestCode, resultCode, data);

}

我在清单中声明它为

   <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

这个错误在应用程序启动后几秒钟出现,但它没有强制关闭,可以简单地为Okay-ed而且它会消失....

这会给任何人敲响声吗?

非常感谢!

0 个答案:

没有答案