0
I have a simple code from Webview and would like to click on the images of the site, download them by asking or downloading directly 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 as much as possible because I am still new in the mobile development industry
Follows 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);
}
}
But what’s the question? You haven’t started solving the problem yet. Are you doubtful about the algorithm? Are you doubtful about how to capture an event? How to save files? How to view dialogs?
– Pablo Almeida
Taking into account that the image may be with an overlapping div or be in a
background-image
, it may not be possible to download any image.– Guilherme Nascimento
Yes, I have doubt in the algorithm, I tried to implement some I found on the internet but could not, the image will be in a wordpress gallery, by the browser I can save pressing the image and clicking on "download image", I would like to do the same but by webview
– Alef Sales