Answer the question
In order to leave comments, you need to log in
Remapping in Android WebViewClient. How?
I assign settings for webViewClient. But I can't reassign from another function. Here I assign and work and correctly:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
webView = (WebView) findViewById(R.id.webView);
webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
SimpleWebViewClientImpl webViewClient = new SimpleWebViewClientImpl(this);
webView.setWebViewClient(webViewClient);
public void pereNaznachenie()
{
PereNaznachenieClass webViewClient = new PereNaznachenieClass(this);
webView.setWebViewClient(webViewClient);
}
java.lang.NullPointerException:
Attempt to invoke virtual method
'void android.webkit.WebView.setWebViewClient(android.webkit.WebViewClient)'
on a null object reference
public void onClick(DialogInterface dialog, int id) {
MainActivity mActivity= new MainActivity();
mActivity.pereNaznachenie();
dialog.cancel();
}
Answer the question
In order to leave comments, you need to log in
It looks like indentation like bootstrap. It container
should be replaced with container-fluid
. But not sure if you have Bootstrap. Not enough information.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question