[Solved] is there a goback() for webview? [closed]

[ad_1] Your back button closes the activity because that’s the normal behaviour. What you need to do if you want to use the back button to act as a Go back button for your WebView is: @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { yourWebView.goBack(); return true; } return super.onKeyDown(keyCode, … Read more

[Solved] webview load url from input text in another class [duplicate]

[ad_1] send data from inputAddrss, Intent intent = new Intent(getBaseContext(), SignoutActivity.class); intent.putExtra(“url”, YOUR_EDIT_TEXT.getText().toString()); startActivity(intent); receive data in MainActivity, String s = getIntent().getStringExtra(“url”); then load into webview view.loadUrl(s); [ad_2] solved webview load url from input text in another class [duplicate]

[Solved] android: how to using image in asset folder in html to load in webview [duplicate]

[ad_1] Try this way its working for me public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String sHtmlTemplate = “<html><head></head><body><img src=\”file:///android_asset/ic_launcher.png\”><p>Hello Webview.</p></body></html>”; WebView wb = new WebView(this); wb.loadDataWithBaseURL(null, sHtmlTemplate, “text/html”, “utf-8”,null); setContentView(wb); } } Output: 2 [ad_2] solved android: how to using image in asset folder in html to … Read more

[Solved] Declare receiver in mainactivity

[ad_1] Instead of registering receiver in manifest , register it in Activity and pass interface to interact on network state change NetworkCallback.java interface NetworkCallback{ void onStateChange(); } ConnectionBroadReceiver.java import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.net.ConnectivityManager; import android.net.NetworkInfo; public class ConnectionBroadReceiver extends BroadcastReceiver { private NetworkCallback callback; public ConnectionBroadReceiver(NetworkCallback callback){ this.callback = callback; } @Override … Read more

[Solved] How to Add Prefix in WebView URL?

[ad_1] In the onClick() method of the button, just concatenate url and the query. @Override public void onClick(View view) { String url = urlEditText.getText().toString(); String prefix = “https://www.google.com/search?q=”; if(!url.startsWith(“http://”) && !url.startsWith(“https://”)) { url = prefix + url; } if(url.endsWith(“.com”) || url.endsWith(“.as”) || url.endsWith(“.uk”) || url.endsWith(“.biz”)) { if(!url.startsWith(“http://”) && !url.startsWith(“https://”)) { url = “http://” + url; … Read more

[Solved] How to load html files as items in listview.?

[ad_1] I found the answer to the problem! I had declared Webview, identifying it before onCreate method in my Second Activity, which has resulted in this problem.! Also in the code, which had provided previously, as putExtra(“stringname”, “value”); And so, after getting extras, in Bundle extras.getExtra(“stringname”); is enough and had previously messed up in that … Read more

[Solved] webview app permission for capturing images using camera and uploading images from gallery

[ad_1] Add in Manifest.xml: <uses-permission android:name=”android.permission.READ_EXTERNAL_STORAGE” /> <uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE” /> For android versions higher than M you have to ask for permissions, I’m referring to this question: Link [ad_2] solved webview app permission for capturing images using camera and uploading images from gallery

[Solved] How can i load a link in other browser from web view?

[ad_1] Try this: webView.setWebViewClient(new WebViewClient(){ public boolean shouldOverrideUrlLoading(WebView view, String url) { if (url != null && (url.startsWith(“http://”) || url.startsWith(“https://”))) { view.getContext().startActivity( new Intent(Intent.ACTION_VIEW, Uri.parse(url))); return true; } else { return false; } } }); 2 [ad_2] solved How can i load a link in other browser from web view?

[Solved] How I can make a course app? [closed]

[ad_1] Yes, you can use HTML to create your pages, and then make your app being just single WebView object showing your pages. You put your HTML pages and related resources in res/assets folder [ad_2] solved How I can make a course app? [closed]

[Solved] ‘Cannot make a static reference to the non-static method’ error android

[ad_1] Change: WebView.setWebViewClient(yourWebClient); to: webView.setWebViewClient(yourWebClient); By capitalizing the “W” in webView, you’re referring to the to the class android.webkit.WebView. This makes Java look for a static method called setWebViewClient() in that class, which it doesn’t find, and hence throws an error. 1 [ad_2] solved ‘Cannot make a static reference to the non-static method’ error android