Android : embedded webview shows location bar after inactive InputConnection message

on Thursday, October 9, 2014


I am developing a simple app, with only an embedded chrome webview that communicates with an embedded http server . There's almost no Android java code in the project. The web app runs fine for about 5 minutes, with the webview fullscreen, and javascript doing all kinds of dom manipulation. The webview has none of the typical browser decoration, only the content area is showing.


After ca. 5 minutes, I see a message in logcat: W/IInputConnectionWrapper﹕ showStatusIcon on inactive InputConnection, and then the embedded chrome webview suddenly shows like a browser. It has a location bar, search, favorites etc...



  • Now I realize somehow the normal browser is launched, with the same url as my webview, so it shows the same poster as my webview. But why? My app isn't launching anything!*


This screws up my whole application, which uses the android+browser combo to show poster like information, and I'd like to get rid of the behavior.


My app doesn't have or need any input, but it needs to run continuously, typically on an android device connected to a large monitor.


Would anyone have any info on solving this issue?


The part of my code that deals with setting up the webview is trivial:



protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
setContentView(R.layout.activity_main);
WebView webView = (WebView) findViewById(webView1);
WebSettings settings = webView.getSettings();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT)
{
WebView.setWebContentsDebuggingEnabled(true);
}
settings.setJavaScriptEnabled(true);


and after that I set up the internal web server, and finally:



String index_html = String.format(Locale.US, "http://localhost:%d/test/index.html", port);
webView.loadUrl(index_html);
}

0 comments:

Post a Comment