2017-02-26 22 views
2

,當我在我的意圖添加字節的數組是這樣的:ToUri()不是將所有多餘的意圖(parcelable,序列化,字節[] ..)

意向意圖=新意圖(「機器人.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);

nerver出現在編碼的URI位圖的數據:

字符串URI = intent.toUri(URI_INTENT_SCHEME);

(URI) - > 意圖:#Intent;動作= android.intent.action.MAIN; launchFlags = 0x10000000的;成分= com.xxxx.xxx/.activity.xxxx;端

由於提前。

回答

2

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' : 
        '\0'; 
相關問題