ToUri() 不会转换所有额外的意图(parcelable、serializable、byte[]..)
ToUri() not convert all extra in intent (parcelable, serializable, byte[]..)
当我像这样在我的意图中添加一个字节数组时:
Intent intent = new Intent("android.intent.action.MAIN" );
Bundle param = new Bundle();
ByteArrayOutputStream bs = new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.PNG, 50, bs);
param.putByteArray("image",bs.toByteArray());
intent.putExtras(param);
位图 nerverer 的数据出现在编码的 uri 中:
String uri = intent.toUri(URI_INTENT_SCHEME);
(uri) ->
intent:#Intent;action=android.intent.action.MAIN;launchFlags=0x10000000;component=com.xxxx.xxx/.activity.xxxx;end
提前致谢。
Intent.toUri()
不支持额外的数组。仅支持以下类型(这取自 Intent.toUri()
的源代码:
char entryType =
value instanceof String ? 'S' :
value instanceof Boolean ? 'B' :
value instanceof Byte ? 'b' :
value instanceof Character ? 'c' :
value instanceof Double ? 'd' :
value instanceof Float ? 'f' :
value instanceof Integer ? 'i' :
value instanceof Long ? 'l' :
value instanceof Short ? 's' :
'[=10=]';
当我像这样在我的意图中添加一个字节数组时:
Intent intent = new Intent("android.intent.action.MAIN" );
Bundle param = new Bundle();
ByteArrayOutputStream bs = new ByteArrayOutputStream();
bmp.compress(Bitmap.CompressFormat.PNG, 50, bs);
param.putByteArray("image",bs.toByteArray());
intent.putExtras(param);
位图 nerverer 的数据出现在编码的 uri 中:
String uri = intent.toUri(URI_INTENT_SCHEME);
(uri) -> intent:#Intent;action=android.intent.action.MAIN;launchFlags=0x10000000;component=com.xxxx.xxx/.activity.xxxx;end
提前致谢。
Intent.toUri()
不支持额外的数组。仅支持以下类型(这取自 Intent.toUri()
的源代码:
char entryType =
value instanceof String ? 'S' :
value instanceof Boolean ? 'B' :
value instanceof Byte ? 'b' :
value instanceof Character ? 'c' :
value instanceof Double ? 'd' :
value instanceof Float ? 'f' :
value instanceof Integer ? 'i' :
value instanceof Long ? 'l' :
value instanceof Short ? 's' :
'[=10=]';