0

I am retrieving URL in web view from fire-base database. its working fine. I want to save this URL in my web view app for future access without internet. just like images and text store as .setPersistanEnable.

  mdataRef = FirebaseDatabase.getInstance().getReference().child("Web");
    webviewthis = (WebView)findViewById(R.id.webView_news);
    this.webviewthis.getSettings().setDomStorageEnabled(true);
    webviewthis.setWebViewClient(new WebViewClient());
    webviewthis.getSettings().setJavaScriptEnabled(true);
    webviewthis.getSettings().setLoadsImagesAutomatically(true);
    mdataRef.addListenerForSingleValueEvent(new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {
            post2web webView = dataSnapshot.getValue(post2web.class);
           // webviewthis.loadUrl(String.valueOf(webView));
            webviewthis.loadUrl(webView.getWebViewPost());
        }
        @Override
        public void onCancelled(DatabaseError databaseError) {

        }
    });


}

}

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • https://stackoverflow.com/questions/8200945/how-to-get-html-content-from-a-webview – em_ Jan 28 '19 at 18:45
  • Sorry Can't understand can u please guide me according to my question? – Economics Pakistan Jan 28 '19 at 18:51
  • When you load a webpage in your URL, you'll want to store that raw html to store for later retrieval - granted the html will only give you text and image references. This isn't a fun battle to fight but that link will get you on the right path. – em_ Jan 28 '19 at 19:02

0 Answers0