How to convert base64 data:url to link url?
<p>example I have url : data:image/png;base64,ajshgvdkau....</p>

<p>I want to convert it to : <a href="http://example.com/pic.png" rel="nofollow">http://example.com/pic.png</a></p>

<p>is there any code to do this in java android ?</p>

<p>==================================</p>

<p>Edit 1</p>

<p>I'm trying to put the image from url and display it to textview. when i use case 2, the image display perfectly, </p>

<p>but in case 1 not. there is error "unknown protocol: data" and "W/AwContents: nativeOnDraw failed; clearing to background color"</p>

<pre><code>        //case 1
//          String base_url = "&lt;p&gt;Image 1 : &lt;img src=\"data:image/jpeg;base64,/9j/4AAQSk...

        //case 2
        String base_url = "&lt;p&gt;Image 1 : &lt;img src=\"http://example.com/android/tryout/logo.png\"&gt;&lt;/img&gt;&lt;/p&gt;";

        Spanned span2 = Html.fromHtml(base_url,getImageHTML(),null);

        TextView tv = (TextView)findViewById(R.id.target);
        tv.setText(span2);
</code></pre>

<p>and this is my function</p>

<pre><code>public Html.ImageGetter getImageHTML() {

    Html.ImageGetter imageGetter = new Html.ImageGetter() {
        public Drawable getDrawable(String source) {
            try {
                Drawable drawable = Drawable.createFromStream(new URL(source).openStream(), "src");
                drawable.setBounds(0, 0, drawable.getIntrinsicWidth(),drawable.getIntrinsicHeight());

                return drawable;
            } catch(IOException exception) {
                Log.v("IOException", exception.getMessage());
                return null;
            }
        }
    };

    return imageGetter;
}
</code></pre>

<p>Thanks for the answer.</p>