{"id":955,"date":"2015-08-14T09:53:51","date_gmt":"2015-08-14T01:53:51","guid":{"rendered":"https:\/\/ai.zhousir.top\/?p=955"},"modified":"2026-08-18T12:58:43","modified_gmt":"2026-08-18T04:58:43","slug":"android%e5%8a%a0%e8%bd%bd%e7%bd%91%e7%bb%9c%e5%9b%be%e7%89%87","status":"publish","type":"post","link":"https:\/\/ai.zhousir.top\/?p=955","title":{"rendered":"Android\u52a0\u8f7d\u7f51\u7edc\u56fe\u7247"},"content":{"rendered":"<section id=\"wenyan\" style=\"font-family: system-ui, 'Apple Color Emoji', 'Segoe UI', 'Segoe UI Symbol', 'Noto Sans', Roboto, sans-serif; line-height: 1.75; font-size: 16px; color: #000000; caret-color: #000000;\" data-provider=\"WenYan\">\n<blockquote style=\"margin: 20px 0px; display: block; font-size: 0.9em; overflow: auto; border-left: 3px solid #ef7060; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"margin: 1em 0px;\">\u52a0\u8f7d\u7f51\u7edc\u56fe\u7247\u548c\u52a0\u8f7d\u5b57\u7b26\u4e32\u7c7b\u4f3c\uff1a\u8d70 Http \u62ff\u5230 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">InputStream<\/code>\uff0c\u518d\u7528 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">BitmapFactory.decodeStream<\/code>\u3002\u8017\u65f6\u5fc5\u987b\u653e\u5f02\u6b65\u4efb\u52a1\u3002\u5217\u8868\u591a\u56fe\u65f6\u8fd8\u8981\u5904\u7406\u6eda\u52a8\u9519\u4f4d\uff1a\u628a AsyncTask \u7ed1\u5230 ImageView \u4e0a\uff0c\u6309 URL \u51b3\u5b9a\u53d6\u6d88\u8fd8\u662f\u590d\u7528\u3002<\/p>\n<\/blockquote>\n<p><!--more--><\/p>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e00\u3001\u4ece URL \u89e3\u7801 Bitmap<\/span><\/h2>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">URL url = new URL(httpUrl);\nInputStream in = url.openStream();\nBitmap bitmap = BitmapFactory.decodeStream(in);<\/code><\/pre>\n<p style=\"margin: 1em 0px;\"><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">url.openStream()<\/code> \u7b49\u4ef7\u4e8e\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">HttpURLConnection conn = (HttpURLConnection) url.openConnection();\nInputStream is = conn.getInputStream();<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u6e90\u7801\u5c31\u662f\u5c01\u88c5\u8fd9\u4e24\u884c\uff1a<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">\/**\n * Equivalent to {@code openConnection().getInputStream(types)}.\n *\/\npublic final InputStream openStream() throws IOException {\n    return openConnection().getInputStream();\n}<\/code><\/pre>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e8c\u3001\u5355\u5f20\u56fe\uff1aAsyncTask + ProgressBar<\/span><\/h2>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">public Bitmap downLoadBitmap(String httpUrl) {\n    InputStream in = null;\n    try {\n        URL url = new URL(httpUrl);\n        in = url.openStream();\n        Bitmap bitmap = BitmapFactory.decodeStream(in);\n        return bitmap;\n    } catch (MalformedURLException e) {\n        e.printStackTrace();\n    } catch (IOException e) {\n        e.printStackTrace();\n    } finally {\n        if (in != null) {\n            try {\n                in.close();\n            } catch (IOException e) {\n                e.printStackTrace();\n            }\n        }\n    }\n    return null;\n}<\/code><\/pre>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">String httpUrl = \"http:\/\/d.hiphotos.baidu.com\/image\/h%3D360\/sign=ba3bf5f839c79f3d90e1e2368aa1cdbc\/f636afc379310a55c01f6ef3b54543a9822610f9.jpg\";\n\nnew AsyncTask&lt;String, Void, Bitmap&gt;() {\n    protected void onPreExecute() {\n        mProgressBar.setVisibility(View.VISIBLE);\n    }\n\n    @Override\n    protected Bitmap doInBackground(String... params) {\n        String httpUrl = params[0];\n        return downLoadBitmap(httpUrl);\n    }\n\n    @Override\n    protected void onPostExecute(Bitmap result) {\n        mProgressBar.setVisibility(View.GONE);\n        if (result != null)\n            mShowImg.setImageBitmap(result);\n    }\n}.execute(httpUrl);<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u754c\u9762\u7528 ImageView\uff0cProgressBar \u8868\u793a\u52a0\u8f7d\u4e2d\uff1a<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2015\/08\/imageloader1.gif\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-956\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2015\/08\/imageloader1.gif\" alt=\"imageloader1\" width=\"376\" height=\"500\" \/><\/a><\/p>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u4e09\u3001\u591a\u56fe\uff1aGridView \u91cc\u76f4\u63a5\u5f00\u4efb\u52a1\u4f1a\u9519\u4f4d<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u53d6\u56fe\u65b9\u5f0f\u548c\u5355\u5f20\u4e00\u6837\uff0c\u663e\u793a\u6362\u6210 GridView\u3002\u4e00\u5c4f\u65f6\u770b\u4e0d\u51fa\u95ee\u9898\uff1b\u56fe\u591a\u3001\u4e0a\u4e0b\u6eda\u65f6 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">getView<\/code> \u53cd\u590d\u542f\u52a8 AsyncTask\uff0c\u5c31\u4f1a<strong>\u56fe\u7247\u9519\u4f4d<\/strong>\u3002<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">@Override\npublic View getView(int position, View convertView, ViewGroup parent) {\n    final ImageView loaderImageView;\n    if (convertView == null) {\n        convertView = mInflater.inflate(R.layout.item_my_gridview_layout, null);\n        loaderImageView = (ImageView) convertView.findViewById(R.id.my_gridview_img);\n        convertView.setTag(loaderImageView);\n    } else {\n        loaderImageView = (ImageView) convertView.getTag();\n    }\n\n    String itemUrl = (String) getItem(position);\n\n    new AsyncTask&lt;String, Void, Bitmap&gt;() {\n        @Override\n        protected Bitmap doInBackground(String... params) {\n            return downLoadBitmap(params[0]);\n        }\n\n        @Override\n        protected void onPostExecute(Bitmap result) {\n            if (result != null)\n                loaderImageView.setImageBitmap(result);\n        }\n    }.execute(itemUrl);\n\n    return convertView;\n}<\/code><\/pre>\n<p style=\"margin: 1em 0px;\">\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n<p style=\"margin: 1em 0px;\"><a href=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2015\/08\/imageloader2.gif\" rel=\"fancybox\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/ai.zhousir.top\/wp-content\/uploads\/2015\/08\/imageloader2.gif\" alt=\"imageloader2\" width=\"365\" height=\"615\" class=\"alignnone size-full wp-image-961\" \/><\/a><\/p>\n<hr>\n<h2 style=\"margin: 1.2em 0px 1em; padding: 0px; font-weight: bold; font-size: 1.3em; border-bottom: 2px solid #ef7060; display: flex;\"><span style=\"display: inline-block; font-weight: bold; background: #ef7060; color: #ffffff; padding: 3px 10px 1px; border-top-right-radius: 3px; border-top-left-radius: 3px; margin-right: 3px;\">\u56db\u3001\u6309 URL \u7ed1\u5b9a \/ \u53d6\u6d88 AsyncTask<\/span><\/h2>\n<p style=\"margin: 1em 0px;\">\u628a\u4efb\u52a1\u5f15\u7528\u5b58\u8fdb\u4e13\u7528 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">AsyncDrawable<\/code>\u3002\u65b0 URL \u4e0e\u6b63\u5728\u8dd1\u7684\u4e0d\u540c\u5c31 <code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">cancel<\/code>\uff1b\u76f8\u540c\u5219\u4e0d\u518d\u5f00\u65b0\u4efb\u52a1\u3002\u5b8c\u6210\u540e\u7528 WeakReference \u786e\u8ba4 ImageView \u4ecd\u5728\uff0c\u4e14\u5f53\u524d\u4efb\u52a1\u4ecd\u662f\u5b83\u8eab\u4e0a\u90a3\u4e2a\uff0c\u624d setImageBitmap\u3002<\/p>\n<pre style=\"overflow: auto hidden; word-break: normal; white-space: pre; tab-size: 2; border-radius: 5px; line-height: 2; margin: 1em 0.5em; padding: 0.5em; box-shadow: rgba(0, 0, 0, 0.55) 0px 1px 5px; font-size: 10px; background: #002b36; max-width: 100%; overflow-wrap: normal;\"><code class=\"hljs\" style=\"word-break: normal; white-space: nowrap; tab-size: 2; font-size: 10px; font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; display: block; margin: 0.5em; padding: 3px 5px; overflow-x: auto; color: #93a1a1; background: #002b36; overflow-wrap: normal;\">public void loadBitmap(Resources res, String imageUrl, ImageView imageView, int resId) {\n    if (cancelPotentialWork(imageUrl, imageView)) {\n        BitmapWorkerTask task = new BitmapWorkerTask(imageView);\n        AsyncDrawable asyncDrawable = new AsyncDrawable(res,\n                BitmapFactory.decodeResource(res, resId), task);\n        imageView.setImageDrawable(asyncDrawable);\n        task.execute(imageUrl);\n    }\n}\n\npublic static boolean cancelPotentialWork(String imageUrl, ImageView imageView) {\n    final BitmapWorkerTask bitmapWorkerTask = getBitmapWorkerTask(imageView);\n    if (bitmapWorkerTask != null) {\n        final String bitmapData = bitmapWorkerTask.imageUrl;\n        if (!bitmapData.equals(imageUrl)) {\n            bitmapWorkerTask.cancel(true);\n        } else {\n            return false;\n        }\n    }\n    return true;\n}\n\nprivate static BitmapWorkerTask getBitmapWorkerTask(ImageView imageView) {\n    if (imageView != null) {\n        final Drawable drawable = imageView.getDrawable();\n        if (drawable instanceof AsyncDrawable) {\n            final AsyncDrawable asyncDrawable = (AsyncDrawable) drawable;\n            return asyncDrawable.getBitmapWorkerTask();\n        }\n    }\n    return null;\n}\n\nstatic class AsyncDrawable extends BitmapDrawable {\n    private final WeakReference&lt;BitmapWorkerTask&gt; bitmapWorkerTaskReference;\n\n    public AsyncDrawable(Resources res, Bitmap bitmap, BitmapWorkerTask bitmapWorkerTask) {\n        super(res, bitmap);\n        bitmapWorkerTaskReference = new WeakReference&lt;BitmapWorkerTask&gt;(bitmapWorkerTask);\n    }\n\n    public BitmapWorkerTask getBitmapWorkerTask() {\n        return (BitmapWorkerTask) bitmapWorkerTaskReference.get();\n    }\n}\n\nclass BitmapWorkerTask extends AsyncTask&lt;String, Void, Bitmap&gt; {\n    private final WeakReference&lt;ImageView&gt; imageViewReference;\n    private String imageUrl = \"\";\n\n    public BitmapWorkerTask(ImageView imageView) {\n        imageViewReference = new WeakReference&lt;ImageView&gt;(imageView);\n    }\n\n    @Override\n    protected Bitmap doInBackground(String... params) {\n        imageUrl = params[0];\n        return downLoadBitmap(imageUrl);\n    }\n\n    @Override\n    protected void onPostExecute(Bitmap bitmap) {\n        if (isCancelled()) {\n            bitmap = null;\n        }\n        if (imageViewReference != null &amp;&amp; bitmap != null) {\n            final ImageView imageView = (ImageView) imageViewReference.get();\n            final BitmapWorkerTask bitmapWorkerTask = getBitmapWorkerTask(imageView);\n            if (this == bitmapWorkerTask &amp;&amp; imageView != null) {\n                imageView.setImageBitmap(bitmap);\n            }\n        }\n    }\n}<\/code><\/pre>\n<table style=\"border-collapse: collapse; margin: 1.4em auto; max-width: 100%; table-layout: fixed; text-align: left; overflow: auto; display: table; overflow-wrap: break-word; word-break: break-all;\" width=\"817\">\n<thead>\n<tr>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">\u573a\u666f<\/th>\n<th style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top; font-weight: bold; background-color: #fff9f9; color: #ef7060;\">\u505a\u6cd5<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u53d6\u6d41<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\"><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">URL.openStream()<\/code> = openConnection().getInputStream()<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u89e3\u7801<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\"><code style=\"font-family: Menlo, Monaco, Consolas, 'Liberation Mono', 'Roboto Mono', 'Courier New', 'Microsoft YaHei', monospace; font-size: 0.9em; overflow-wrap: break-word; padding: 2px 4px; border-radius: 4px; margin: 0px 2px; color: #ef7060; background-color: rgba(27, 31, 35, 0.05); word-break: break-all;\">BitmapFactory.decodeStream<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u5355\u5f20<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">AsyncTask + ProgressBar<\/td>\n<\/tr>\n<tr>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">\u5217\u8868\u590d\u7528<\/td>\n<td style=\"font-size: 0.75em; padding: 9px 12px; line-height: 22px; border: 1px solid #ef7060; vertical-align: top;\">AsyncDrawable \u5b58\u4efb\u52a1\u5f15\u7528\uff0cURL \u4e0d\u540c\u5219 cancel<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote style=\"margin: 20px 0px; display: block; font-size: 0.9em; overflow: auto; border-left: 3px solid #ef7060; color: #6a737d; padding: 10px 10px 10px 20px; background: #fff9f9;\">\n<p style=\"margin: 1em 0px;\"><strong>\u4e00\u53e5\u8bdd\u603b\u7ed3\uff1a\u7f51\u7edc\u56fe = \u5f00\u6d41 decodeStream\uff0c\u5fc5\u987b\u5f02\u6b65\uff1bGridView \u590d\u7528\u65f6\u8981\u628a AsyncTask \u7ed1\u5728 ImageView \u4e0a\uff0c\u6309 URL \u53d6\u6d88\u65e7\u4efb\u52a1\uff0c\u907f\u514d\u6eda\u52a8\u9519\u4f4d\u3002<\/strong><\/p>\n<\/blockquote>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u52a0\u8f7d\u7f51\u7edc\u56fe\u7247\u548c\u52a0\u8f7d\u5b57\u7b26\u4e32\u7c7b\u4f3c\uff1a\u8d70 Http \u62ff\u5230 InputStream\uff0c\u518d\u7528 BitmapFactory.d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[66,202],"_links":{"self":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/955"}],"collection":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=955"}],"version-history":[{"count":3,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/955\/revisions"}],"predecessor-version":[{"id":963,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=\/wp\/v2\/posts\/955\/revisions\/963"}],"wp:attachment":[{"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ai.zhousir.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}