您好我想打開這個url http://3864.cloud-matic.net/從我的android webview和我已經嘗試了很多方法,但應用程序甚至不打開mainActivity。我試過的是以下。在Android的BasicAuthentication for webview不工作
public void onCreate(Bundle state) {
super.onCreate(state);
setContentView(R.layout.main);
WebView webView = (WebView) findViewById(R.id.webView1);
webView.setHttpAuthUsernamePassword("cloud-matic.net/", "realm", username, password);
webView.loadUrl("http://3864.cloud-matic.net/");
}
請給我想法我錯了。 阿里
「應用程序甚至不打開mainActivity」你會得到某種錯誤或崩潰或只是一個空白的屏幕? – hypd09
你能提供一個logcat嗎? – PsyGik
首先,我需要問什麼是「realm」,它在setHttpAuthUsernamePassword函數中使用。如果我在共享logcat之前缺少一些值,那麼? – Ali