Back to project page SevenWonders.
The source code is released under:
Apache License
If you think the Android project SevenWonders listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package skylight1.sevenwonders; //from w w w. j a v a 2 s. co m import skylight1.sevenwonders.view.TextStyles; import android.app.Activity; import android.content.ComponentName; import android.content.pm.PackageInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.webkit.WebView; import android.widget.Button; import android.widget.TextView; /** * About box launched from the menu. * * @author Rob */ public class AboutActivity extends Activity { private String buildAboutText() { ComponentName comp = new ComponentName(this, AboutActivity.class); PackageInfo pi = null; try { pi = getPackageManager().getPackageInfo(comp.getPackageName(), 0); } catch (NameNotFoundException e) { return "Seven Wonders"; // what else can you do? } return getString(R.string.aboutText1) + " " + pi.versionName + getString(R.string.aboutText2); } @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.about); final TextStyles textStyles = new TextStyles(this); final TextView aboutText = (TextView) findViewById(R.id.aboutText); aboutText.setText(buildAboutText()); textStyles.applyBodyTextStyle(aboutText); final Button website = (Button) findViewById(R.id.visitWebsite); textStyles.applyHeaderTextStyle(website); website.setOnClickListener(new OnClickListener() { @Override public void onClick(final View v) { final String websiteUri = getString(R.string.website_uri); final WebView wv = new WebView(AboutActivity.this); wv.loadUrl(websiteUri); AboutActivity.this.setContentView(wv); } }); } }