나는 죽이려는 웹보기가 있지만 힘든 놈입니다! 나는 시도했다 : 내 활동Android WebView가 완료되지 않았습니다
:
@Override
protected void onStop() {
if (webView_ != null) {
webView_.finish(getApplicationContext());
webView_.destroy();
webView_ = null;
}
super.onStop();
}
내 웹뷰에서
:public void finish(Context context) {
stopLoading();
pauseTimers();
if (alarm_ != null)
alarm_.cancelAlarm(context);
if (webViewErrorHandler_ != null)
webViewErrorHandler_.removeCallbacks(reloadRunnable_);
if (requestQueue_ != null) {
requestQueue_.clear();
requestQueue_ = null;
}
callHiddenWebViewMethod("onPause");
}
private void callHiddenWebViewMethod(String name){
if(this != null){
try {
Method method = WebView.class.getMethod(name);
method.invoke(this);
} catch (NoSuchMethodException e) {
Log.e("MYWEBVIEW", "No such method: " + name);
} catch (IllegalAccessException e) {
Log.e("MYWEBVIEW", "Illegal Access: " + name);
} catch (InvocationTargetException e) {
Log.e("MYWEBVIEW", "Invocation Target Exception: " + name);
}
}
}
하지만 난 디버거에서 볼 때 여전히 웹보기가 실행 스레드가!
그리고 당신은 내가 특히이 onPause 후 작업 할 것을 알아야합니다)
onStop이 호출되었습니다. - 이것을 확인했습니다. 그리고 나는 onPause에서 Timers를 멈추고 싶지 않다고 썼다. 백그라운드에서 작동하도록 내 webview를 원합니다. 웹 뷰는 보이지 않지만 사이트를 구문 분석합니다. – karex