Hi,
I launch an application called DecisionTreeActivity by this code :
Intent i = new Intent(Intent.ACTION_MAIN);
ComponentName toLaunch;
toLaunch = new ComponentName("com.tests.decisionTree",
com.tests.decisionTree.DecisionTreeActivity");
i.addCategory(Intent.CATEGORY_LAUNCHER);
i.setComponent(toLaunch);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
this.startActivityForResult(i, 42);
Then, in DecisionTreeActivity, I send the result back with :
Intent i = new Intent();
i.putExtra("decision", outputToReturn);
setResult(RESULT_FIRST_USER, i);
this.finish();
Here is my onActivityResult(int requestCode, int resultCode, Intent
data) function. Everything is working fine when these activities are
in the same apk file but here I have to put them into two separate apk
files.
onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
System.out.println(requestCode + " " + resultCode);
if(requestCode == 42) {
String s = (String) data.getStringExtra("decision");
System.out.println(">>>>>>>>>> Decision: " + s + "
<<<<<<<<<<<<<");
}
}
When onActivityResult is "called", I have those exceptions thrown :
10-03 15:41:09.681: ERROR/vold(31): Unable to lookup media '/devices/
platform/msm_sdcc.1/mmc_host/mmc0/mmc0:0001'
10-03 15:41:09.681: ERROR/vold(31): Error processing uevent msg (No
such file or directory)
10-03 15:41:16.841: ERROR/vold(31): Unable to lookup media '/devices/
platform/msm_sdcc.1/mmc_host/mmc0/mmc0:0001'
10-03 15:41:16.841: ERROR/vold(31): Error processing uevent msg (No
such file or directory)
10-03 15:41:24.311: ERROR/vold(31): Unable to lookup media '/devices/
platform/msm_sdcc.1/mmc_host/mmc0/mmc0:0001'
10-03 15:41:24.311: ERROR/vold(31): Error processing uevent msg (No
such file or directory)
10-03 15:41:32.211: ERROR/AndroidRuntime(1452): Uncaught handler:
thread main exiting due to uncaught exception
10-03 15:41:32.321: ERROR/AndroidRuntime(1452):
java.lang.RuntimeException: Failure delivering result ResultInfo
{who=null, request=42, result=0, data=null} to activity
{com.tests.profiling/com.tests.essai.ModelApplyActivity}:
java.lang.NullPointerException
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
android.app.ActivityThread.deliverResults(ActivityThread.java:3005)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
android.app.ActivityThread.handleSendResult(ActivityThread.java:3047)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
android.app.ActivityThread.access$2300(ActivityThread.java:112)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1721)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
android.os.Handler.dispatchMessage(Handler.java:99)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
android.os.Looper.loop(Looper.java:123)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
android.app.ActivityThread.main(ActivityThread.java:3948)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
java.lang.reflect.Method.invokeNative(Native Method)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
java.lang.reflect.Method.invoke(Method.java:521)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
(ZygoteInit.java:782)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
dalvik.system.NativeStart.main(Native Method)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): Caused by:
java.lang.NullPointerException
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
com.tests.essai.ModelApplyActivity.onActivityResult
(ModelApplyActivity.java:192)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
android.app.Activity.dispatchActivityResult(Activity.java:3595)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): at
android.app.ActivityThread.deliverResults(ActivityThread.java:3001)
10-03 15:41:32.321: ERROR/AndroidRuntime(1452): ... 11 more
10-03 15:41:32.381: ERROR/vold(31): Unable to lookup media '/devices/
platform/msm_sdcc.1/mmc_host/mmc0/mmc0:0001'
10-03 15:41:32.381: ERROR/vold(31): Error processing uevent msg (No
such file or directory)
I really don't understand what the problem is. What changes when I
associated these two activities with different apk file.
Note that the important line is :
10-03 15:41:32.321: ERROR/AndroidRuntime(1452):
java.lang.RuntimeException: Failure delivering result ResultInfo
{who=null, request=42, result=0, data=null} to activity
where we can read that the intent is null (that is really not
normal !!)
Could you help me ?
Thanks,
Regard,
D.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---