Progressdialogu kapatamıyorum.
25.04.2017 - 01:15
Arkadaslar webview li uygulama yaptım ancak yükleniyor yazısını bir türlü kapatamadım.
onPageFinished kodunu tanımıyor android studio kodlarım;
package com.wordpresssite.com.wordpress;
import android.app.ProgressDialog;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Window;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
private WebView mWebview;
private ProgressDialog ProgressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_fullscren);
WebView tarayici;
tarayici=(WebView)findViewById(R.id.mWebView);
tarayici.getSettings().setJavaScriptEnabled(true);
tarayici.setWebViewClient(new WebViewClient());
tarayici.setWebChromeClient(new WebChromeClient());
tarayici.loadUrl("http://wordpress.com");
//webview
mWebview=(WebView) findViewById(R.id.mWebView);
WebSettings websetting=mWebview.getSettings();
websetting.setJavaScriptEnabled(true);
mWebview.loadUrl("http://wordpress.com");
final ProgressDialog progressDialog = ProgressDialog.show(this, "Wordpress",
"Sayfa Yükleniyor...", true);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (event.getAction()==KeyEvent.ACTION_DOWN){
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
if (mWebview.canGoBack()) {
mWebview.goBack();
}
else {
finish();
}
return true;
}
}
return super.onKeyDown(keyCode, event);
}
}
4
Görüntülenme
0 Beğeni