WebView, Download Image

0

I have a simple Webview code and would like that when clicking on the images of the site, download them asking or downloading direct and sending a message like "saved image"

Note 1: I used a tumblr to do the tests Note 2: I would like to simplify the code to the max as I am still new to the mobile development branch

Follow the code ...

package com.tumblr.k3rn3l.wallpapers;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        getSupportActionBar().hide(); //Oculta a Barra Azul
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        WebView view = (WebView) this.findViewById(R.id.WebView);
        view.setWebViewClient(new WebViewClient());
        view.loadUrl("http://k3rn3l.tumblr.com");
        view.getSettings().setJavaScriptEnabled(true);
    }

}
    
asked by anonymous 14.10.2017 / 17:27

0 answers