gluon - Android back button closes app -
i'm showing local html file in webview
center node of glisten view
. when presss android button, instead of going previous view, app gets closed. when use appbar button switch previous view works fine. tried attach event filter both, webview , scene, doesn't triggered.
javafxports version: 8.60.6
update:
the issue occures when webview focused.
public class importhelppresenter extends basepresenter { @fxml private webview web; @override protected void initialize() { super.initialize(); web.setcontextmenuenabled(false); loadhelppage(); } private void loadhelppage() { string htmlcontent = null; try { htmlcontent = readcontent("importhelp.html"); } catch (ioexception e) { e.printstacktrace(); } web.getengine().loadcontent(htmlcontent); } string readcontent(string filename) throws ioexception { inputstream = getclass().getresourceasstream(filename); bufferedreader br = new bufferedreader(new inputstreamreader(is)); try { stringbuilder sb = new stringbuilder(); string line = br.readline(); while (line != null) { sb.append(line); line = br.readline(); } return sb.tostring(); } { br.close(); } } eventhandler<? super keyevent> backbuttonfilter = evt -> { system.out.println(evt); if (keycode.escape.equals(evt.getcode())) { evt.consume(); showpreviousview(); } }; @override protected void onshown() { super.onshown(); web.getscene().addeventfilter(keyevent.any, backbuttonfilter); web.addeventfilter(keyevent.any, backbuttonfilter); } @override protected void onhidden() { web.getscene().removeeventfilter(keyevent.any, backbuttonfilter); web.removeeventfilter(keyevent.any, backbuttonfilter); } }
logcat:
04-19 04:49:54.760: v/internalwebview(11536): webview added viewgroup [x: 0, y: 84 , w: 480 h: 678] 04-19 04:49:54.760: v/internalwebview(11536): loading content: <html> //content omitted 04-19 04:49:54.930: d/webcoreglue(11536): netstack: memory cache feature on 04-19 04:49:55.070: v/chromium(11536): external/chromium/net/host_resolver_helper/host_resolver_helper.cc:66: [0419/044955:info:host_resolver_helper.cc(66)] dnspreresolver::init got hostprovider:0x51d36010 04-19 04:49:55.070: v/chromium(11536): external/chromium/net/base/host_resolver_impl.cc:1510: [0419/044955:info:host_resolver_impl.cc(1510)] hostresolverimpl::setpreresolver preresolver:0x51d25d10 04-19 04:49:55.070: d/hoststatisticmanager(11536): netstack: dns host prioritization is: on, version: 5.0.1 04-19 04:49:55.080: d/(11536): external/chromium/net/socket/tcp_fin_aggregation_factory.cc: libtcpfinaggr.so loaded 04-19 04:49:55.080: d/(11536): external/chromium/net/socket/tcp_fin_aggregation_factory.cc,: tcp fin aggregation initializing method found in libtcpfinaggr.so 04-19 04:49:55.080: d/tcpfinaggregation(11536): netstack: tcpfinaggregation 1, version 5.0.1 04-19 04:49:55.080: d/tcpfinaggregation(11536): system property net.tcp.fin.aggregation.wait set, value: 20 04-19 04:49:55.080: d/tcpfinaggregation(11536): system property net.tcp.fin.aggregation.close set, value: 300 04-19 04:49:55.080: d/tcpfinaggregation(11536): netstack: closeunusedsockets on, (tcpfinaggregation), version 5.0.1 04-19 04:49:55.080: d/tcpfinaggregation(11536): failed network status! received ret: -2 04-19 04:49:55.080: d/socket_pool(11536): netstack: closeunusedsockets on 04-19 04:49:55.080: d/socket_pool(11536): netstack: system net.statistics value: 0 04-19 04:49:55.080: d/socket_pool(11536): netstack: closeunusedsockets on 04-19 04:49:55.080: d/socket_pool(11536): netstack: system net.statistics value: 0 04-19 04:49:55.090: d/(11536): external/chromium/net/http/http_getzip_factory.cc: libgetzip.so loaded 04-19 04:49:55.090: d/(11536): external/chromium/net/http/http_getzip_factory.cc,: getzip initializing method found in libgetzip.so 04-19 04:49:55.090: d/netstack(11536): netstack: request priority on 04-19 04:49:55.090: d/(11536): netstack: getzip is: on, version: 5.0.1 04-19 04:49:55.180: d/webkit(11536): error: 04-19 04:49:55.180: d/webkit(11536): alias gb18030 maps gb18030 already, trying make map gbk 04-19 04:49:55.180: d/webkit(11536): external/webkit/source/webcore/platform/text/textencodingregistry.cpp(152) : void webcore::checkexistingname(char const*, char const*) 04-19 04:50:00.120: e/dalvikvm(11536): gc_concurrent freed 1207k, 24% free 17251k/22599k, paused 5ms+7ms, total 350ms 04-19 04:50:02.810: d/audiomanager(11536): currentdevicetype = 1 04-19 04:50:02.870: v/fxactivity(11536): onpause 04-19 04:50:03.690: w/iinputconnectionwrapper(11536): showstatusicon on inactive inputconnection 04-19 04:50:03.770: v/fxentity(11536): called surface destroyed 04-19 04:50:03.780: v/fxactivity native(11536): [jvdbg] surface created native android window @ 0x0, surface = 0x0 04-19 04:50:03.790: i/glass(11536): native code notified surface has changed (repaintall)! 04-19 04:50:04.210: w/managedeglcontext(11536): doterminate failed: egl count 2 managed count 1 04-19 04:50:04.210: v/fxactivity(11536): onstop 04-19 04:50:04.210: v/fxactivity(11536): ondestroy
Comments
Post a Comment