我已启用我的应用程序以通过HTML页面中的选项共享。现在,我正试图在我的SD卡中存储从哪里触发的HTML页面。为此,我试图使用意图内容。Android:通过意向接收HTML页面
我用图像以下和它的工作般的魅力..
Uri imageUri = (Uri) shareintent.getParcelableExtra(Intent.EXTRA_STREAM);
Uri uri = (Uri) extras.getParcelable(Intent.EXTRA_STREAM);
ContentResolver cr = getContentResolver();
InputStream is = cr.openInputStream(uri);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = false;
Bitmap imageBitmap = BitmapFactory.decodeStream(is ,null, options);
请你能给我如何将HTML页面保存在SD卡我的暗示?
我不知道浏览器把HTML页面本身放到'ACTION_SEND''Intent'中。该页面的URL将发给您。 – CommonsWare
好的。那么,在这种情况下,我能以某种方式存储url内容的本地副本吗? –
不管您喜欢如何使用URL,例如使用'HttpUrlConnection'下载页面。请记住,它可能无法下载该页面,因为您不会有会话cookie,身份验证详细信息等。 – CommonsWare