WebView: Enforcing Sequenced Display Timing -
i need tutorial-level displaying webview content in timed sequence.
below testbed illustrate, manifest bog-standard webview in relativelayout.
package com.example; import android.app.activity; import android.os.bundle; import android.webkit.webview; import android.widget.relativelayout; public class myactivity extends activity { private string imgpath; // empty testing /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); final webview mwebview1; mwebview1 = (webview) findviewbyid(r.id.webviewcard1); mwebview1.setlayoutparams(new relativelayout.layoutparams(300,200)); string fill = "first content"; mwebview1.loaddatawithbaseurl(imgpath, fill, "text/html", "utf-8",null); /* want above load, display first content (text, image(s), play sound files) pause preset time before doing same second content */ fill = "second content"; mwebview1.loaddatawithbaseurl(imgpath, fill, "text/html", "utf-8",null); } } so how enforce wait of n seconds between loaddatawithbaseurls (on same or different webviews)?
tia,
ken
how about: mwebview1.postdelayed(..., timeout);
or
executors.newsinglethreadscheduledexecutor().schedulewithfixeddelay(command, initialdelay, delay, unit);
i think timer do, make sure call webview methods on ui thread.
Comments
Post a Comment