我有一个意图来分享视图中的图像。它有效,但是一旦我取消它就可以在Instagram上传,我收到了一个例外。
谷歌没有帮助......意图
if(!getStringName().equals(" ")) {//check if it is usefull
LinearLayout table=(LinearLayout) findViewById(R.id.table_linear);
table.setDrawingCacheEnabled(true);
Bitmap bitmap = table.getDrawingCache();
String imagepath=saveBitmap(bitmap);
//sv.setDrawingCacheEnabled(false);
Intent shareImage=new Intent();
shareImage.setAction(Intent.ACTION_SEND);
shareImage.setType("image/png");
shareImage.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.app_name));
shareImage.putExtra(Intent.EXTRA_TEXT, getStringName());
shareImage.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new File(imagepath)));
startActivity(shareImage);
//new RalaAlertToast(context, getString(R.string.share_success), false);
}else {
//show message, that it's not useful
}
堆栈跟踪
java.lang.RuntimeException: Unable to start activity ComponentInfo{at.ralaweb.ralaprogramme.subnetztabelle/at.ralaweb.ralaprogramme.subnetztabelle.ActivityMain}: java.lang.RuntimeException: Parcel android.os.Parcel@41f7d760: Unmarshalling unknown type code 2131558402 at offset 200
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2227)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2276)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5146)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:796)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:612)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: Parcel android.os.Parcel@41f7d760: Unmarshalling unknown type code 2131558402 at offset 200
at android.os.Parcel.readValue(Parcel.java:2080)
at android.os.Parcel.readSparseArrayInternal(Parcel.java:2363)
at android.os.Parcel.readSparseArray(Parcel.java:1735)
at android.os.Parcel.readValue(Parcel.java:2070)
at android.os.Parcel.readArrayMapInternal(Parcel.java:2314)
at android.os.Bundle.unparcel(Bundle.java:249)
at android.os.Bundle.getSparseParcelableArray(Bundle.java:1273)
at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1794)
at android.app.Activity.onRestoreInstanceState(Activity.java:948)
at android.app.Activity.performRestoreInstanceState(Activity.java:920)
at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1138)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
... 12 more
另一件事:我应该在导出后禁用绘图缓存吗?