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

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -