WebView crashes when launching application on gingerbread device

I am starting an android and my application is running in debug mode, but when it starts it crashes.
Here is my code.
I am trying to open a third-party application in webview.
This application uses javascript and is used on Android 2.3 GingerBread.

public class Classname extends Activity { WebView webView; String realm; String username; String password; String host; public String pwd; @Override public void onCreate(Bundle savedInstanceState) { setContentView(R.layout.webpage); super.onCreate(savedInstanceState); webView = (WebView)findViewById(R.id.browser); //final WebPage webpage=new WebPage(webView); //webView.getSettings().setJavaScriptEnabled(true); webView.setVerticalScrollbarOverlay(true); //call url from database ClassName.geturl(getContext(), new Callback<String>(getContext()){ @Override public void onCompleted(String value) { super.onCompleted(value); try { JSONObject respObj = new JSONObject(value); String apserver = respObj.getString("value"); //webView.loadUrl("http://yahoo.com"); webView.getSettings().setJavaScriptEnabled(true); webView.setWebViewClient( new WebViewClient(){ //passing username and pasword public void onReceivedHttpAuthRequest (WebView view,HttpAuthHandler handler, String host,String realm){ final String uname=App.getConfig().getUid(); try { pwd = EncryptDecrypt.decrypt(function.getPassword()); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } handler.proceed(uname, pwd); }} ); webView.loadUrl("application"); ;} catch(Exception e) { } return; } }); } } 

Logcat:

 12-20 13:34:17.160: E/AndroidRuntime(10452): FATAL EXCEPTION: WebViewCoreThread 12-20 13:34:17.160: E/AndroidRuntime(10452): java.lang.IllegalArgumentException: Method name may not be null 12-20 13:34:17.160: E/AndroidRuntime(10452): at org.apache.http.message.BasicHttpRequest.<init>(BasicHttpRequest.java:57) 12-20 13:34:17.160: E/AndroidRuntime(10452): at android.net.http.Request.<init>(Request.java:123) 12-20 13:34:17.160: E/AndroidRuntime(10452): at android.net.http.RequestQueue.queueRequest(RequestQueue.java:333) 12-20 13:34:17.160: E/AndroidRuntime(10452): at android.webkit.Network.requestURL(Network.java:191) 12-20 13:34:17.160: E/AndroidRuntime(10452): at android.webkit.LoadListener.doRedirect(LoadListener.java:1371) 12-20 13:34:17.160: E/AndroidRuntime(10452): at android.webkit.LoadListener.handleMessage(LoadListener.java:236) 12-20 13:34:17.160: E/AndroidRuntime(10452): at android.os.Handler.dispatchMessage(Handler.java:99) 12-20 13:34:17.160: E/AndroidRuntime(10452): at android.os.Looper.loop(Looper.java:123) 12-20 13:34:17.160: E/AndroidRuntime(10452): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:629) 12-20 13:34:17.160: E/AndroidRuntime(10452): at java.lang.Thread.run(Thread.java:1019) 
+4
source share

Source: https://habr.com/ru/post/1387478/


All Articles