package se.nekotronic.satelliterush; import android.app.Activity; import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.os.Bundle; import android.text.Html; import android.text.method.LinkMovementMethod; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.TextView; public class HelpActivity extends Activity implements OnClickListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.help); final Button back = (Button)findViewById(R.id.back_button); back.setOnClickListener(this); TextView view = (TextView) findViewById(R.id.helpview); String text = getString(R.string.help_text); try { PackageManager manager = getPackageManager(); PackageInfo info = manager.getPackageInfo("se.nekotronic.satelliterush", 0); String version_name = info.versionName; // int version_code = info.versionCode; text += "This is Satellite Rush version " + version_name + ".

"; // Not <br> here! } catch(NameNotFoundException nnf) { // Couldn't find the version number. Just ignore it. } view.setText(Html.fromHtml(text)); view.setMovementMethod(LinkMovementMethod.getInstance()); } @Override public void onClick(View v) { finish(); // Finish this activity } } // class HelpActivity