android - option menu not working with Webview? -
android - option menu not working with Webview? -
i using webview in activity , want utilize alternative menu too. not display alternative menu on clicking menu button 1 guide me problem?
oncreate { _webview.setwebviewclient(new webviewclient() { @override public void onpagestarted(webview view, string url, bitmap favicon) { super.onpagestarted(view, url, favicon); //if(_dialog != null && !_dialog.isshowing()) // _dialog.show(); } @override public void onpagefinished(webview view, string url) { super.onpagefinished(view, url); if (_dialog != null && _dialog.isshowing()) { _dialog.dismiss(); } } @override public void onreceivederror(webview view, int errorcode, string description, string failingurl) { if (constants.log) log.d("recieved error", ""); super.onreceivederror(view, errorcode, description, failingurl); seek { if (_dialog != null && _dialog.isshowing()) _dialog.dismiss(); } grab (exception e) { } } }); _webview.loadurl(constants.url_volunteer); }
menu
public boolean oncreateoptionsmenu(menu menu) { menu.add(0, 0, 0, constants.menu_item_home); homecoming super.oncreateoptionsmenu(menu); } @override public boolean onoptionsitemselected(menuitem item) { switch (item.getitemid()) { case 0: intent intenthomescreen= new intent(this,homescreen.class); intenthomescreen.setflags(intent.flag_activity_clear_top); startactivity(intenthomescreen); break; } homecoming super.onoptionsitemselected(item); } @override public boolean onkeydown(int keycode, keyevent event) { if(keycode == keyevent.keycode_back) { if(_dialog != null) _dialog.dismiss(); if(_webview != null) _webview.stoploading(); this.finish(); } homecoming true; }
there nil webview
interferes options menus, afaik. have created activities webview
, options menu before, though not in around 9 months. remove webview
temporarily -- if options menu still misbehaves, have other issue, such malformed onkeydown()
implementation.
android webview
Comments
Post a Comment