我尝试调用MMS
的 Attach Image Activity
,这是我的代码:
Intent intent2 = new Intent("com.android.mms.action.ATTACH_IMAGE");
intent2.setType("image/*");
intent2.putExtra(Intent.EXTRA_STREAM, mUri);
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
e.printStackTrace(System.err);
}
但我得到了这个例外:
m.android.mms/com.android.mms.AttachImage}: java.lang.IllegalAccessException: access to class not allowed
E/AndroidRuntime( 673): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2219)
E/AndroidRuntime( 673): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2332)
E/AndroidRuntime( 673): at android.app.ActivityThread.access$1800(ActivityThread.java:110)
E/AndroidRuntime( 673): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1717)
E/AndroidRuntime( 673): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 673): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 673): at android.app.ActivityThread.main(ActivityThread.java:4021)
E/AndroidRuntime( 673): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 673): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 673): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
E/AndroidRuntime( 673): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
E/AndroidRuntime( 673): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 673): Caused by: java.lang.IllegalAccessException: access to class not allowed
E/AndroidRuntime( 673): at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime( 673): at java.lang.Class.newInstance(Class.java:1472)
E/AndroidRuntime( 673): at android.app.Instrumentation.newActivity(Instrumentation.java:1097)
E/AndroidRuntime( 673): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
你能告诉我为什么吗?谢谢你。