android - WebAppInterface in WebView does not call onBackPressed -
i've fragment webview inside. added custom webappinterface has method
@javascriptinterface public void submitcorrect() { log.d("submit", "submit"); getactivity().onbackpressed(); //getactivity().getfragmentmanager().popbackstack(); }
debugging saw method called but, don't know why, neither onbackpressed or popbackstack working. advice?
perhaps finishing activity instead work:
@javascriptinterface public void submitcorrect() { log.d("submit", "submit"); activity activity = getactivity(); if (activity != null) activity.finish(); }
Comments
Post a Comment