Back to project page LyricHere.
The source code is released under:
Apache License
If you think the Android project LyricHere 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 cn.zhaiyifan.lyrichere.ui; /*from w ww. j a v a2s. co m*/ import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.view.MenuItem; import android.widget.TextView; import cn.zhaiyifan.lyrichere.R; public class AboutActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); TextView versionTextView = (TextView) findViewById(R.id.about_version_name); try { PackageInfo pi = this.getPackageManager().getPackageInfo(this.getPackageName(), 0); versionTextView.setText(String.format("%s %s", getString(R.string.about_version), pi.versionName)); } catch (PackageManager.NameNotFoundException e) { e.printStackTrace(); } } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } }