Saturday, January 31, 2009

Webkit About box

This is kind of overkill for an About dialog, but the neat thing is you can click on the URL and go right to the web page. Hitting the back button returns to your application so it is very smooth


public class about extends Activity {
WebView aboutText;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.about);
aboutText = (WebView)findViewById(R.id.about_text);
String str = "<I>Yoga Timer</I><HR/>Version 1.4<BR/>" +
"<P>Patterns multiply the starting value to set separate durations for the four parts of the breath: <UL>" +
"<LI>Inhalation (Pooraka)<LI>Retention (Abhyantar Kumbhaka)<LI>Exhalation (Rechaka)<LI>Suspension (Bahya Kumbhaka)</UL>" +
"<P>Check for new versions here <A href=http://cubicware.com/>CUBICWARE.COM</A>";
aboutText.loadData(str, "text/html", "utf-8");
Button okButton = (Button) findViewById(R.id.okButton);
okButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
finish();
}
});
}
}

No comments:

Post a Comment