我试图在Smartwatch中显示一个外部图像(而不是在我的应用程序项目中)。我知道如何处理位于绘图文件夹中的图像。
Bundle iconBundle = new Bundle();
iconBundle.putInt(Control.Intents.EXTRA_LAYOUT_REFERENCE, R.id.thumbnail);
iconBundle.putString(Control.Intents.EXTRA_DATA_URI,
ExtensionUtils.getUriString(mContext, R.drawable.thumbnail_list_item));在本例中,可绘图文件夹中有一个名为R.drawable.thumbnail_list_item的图像。问题是当我尝试使用外部图像时。我有以下网址:http://tcset.com/images/logotcsetarriba.png,这段代码不起作用:
Bundle iconBundle = new Bundle();
iconBundle.putInt(Control.Intents.EXTRA_LAYOUT_REFERENCE, R.id.thumbnail);
iconBundle.putString(Control.Intents.EXTRA_DATA_URI,
ExtensionUtils.getUriString(mContext, "http://tcset.com/images/logotcsetarriba.png"));我怎么能做到呢?我需要抱抱:谢谢!!
发布于 2014-11-22 20:27:38
您必须先将外部映像下载到设备。那么您可能必须使用http://developer.sonymobile.com/reference/sony-addon-sdk/com/sonyericsson/extras/liveware/extension/util/control/ControlExtension#showBitmap(Bitmap)。
发布于 2015-01-16 19:01:36
您需要首先下载图像,然后可以使用sendImage与要替换的图像id和下载的位图相结合。例如:
sendImage(R.id.image, bmp);这能回答你的问题吗?
发布于 2015-10-11 16:39:14
难以置信,但实际上您可以显示一个不是来自特定ImageView中的资源的图像。它归结为下载图像到一个byteArray,创建一个捆绑,并将图像作为Control.Intents.EXTRA_DATA传递。
Bundle iconBundle = new Bundle();
iconBundle.putInt(Control.Intents.EXTRA_LAYOUT_REFERENCE, R.id.imageView);
iconBundle.putByteArray(Control.Intents.EXTRA_DATA, buffer);
showLayout(layoutId, layoutId, layoutId, new Bundle[] {iconBundle})我不知道索尼为什么忽略了这样一个有用的功能。
https://stackoverflow.com/questions/26994054
复制相似问题