2
我想在我的應用程序中添加一個加載器對話框到我的webview。那麼,你能幫我解決這個問題嗎?如何將加載器對話框添加到我的webview?
這是我的WebView 代碼:
public class AlTibbiWebViewActivity extends Activity {
private WebView wv;
private Intent incomingIntent = null;
private WebViewClient wvc = new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
wv.loadUrl(url);
return true;
}
};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.web_view);
this.wv = (WebView) findViewById(R.id.webView);
this.wv.setWebViewClient(wvc);
wv.getSettings().setJavaScriptEnabled(true);
this.incomingIntent = getIntent();
String urlToLoad = incomingIntent.getExtras().getString("urlToLoad");
//EXTRA HEADER MAP (remove header from web view)
Map<String, String> aMap = new HashMap<String, String>() ;
aMap.put("app", "no");
//myMap = Collections.unmodifiableMap(aMap);
wv.loadUrl(urlToLoad , aMap);
}
我有小錯誤我的朋友:)我把代碼只是像你的文章,但我得到的錯誤,在過去}); – aziz
我應該在哪裏將我的代碼放在我的代碼中? – aziz
在oncreate方法 – Jamshid