package se.slide.sgu; import android.app.ActionBar; import android.content.pm.PackageInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.Window; import android.widget.TextView; import se.slide.sgu.gcm.GcmRegistrationAsyncTask; public class AboutActivity extends FragmentActivity { @Override protected void onCreate(Bundle arg0) { super.onCreate(arg0); getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY); ActionBar actionBar = getActionBar(); actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#000000ff"))); actionBar.setStackedBackgroundDrawable(new ColorDrawable(Color.parseColor("#000000ff"))); setContentView(R.layout.about); PackageInfo pInfo = null; try { pInfo = getPackageManager().getPackageInfo(getPackageName(), 0); } catch (NameNotFoundException e) { e.printStackTrace(); } String v = "N/A"; if (pInfo != null) v = pInfo.versionName; String message = String.format(getResources().getString(R.string.version), v); TextView textViewVersion = (TextView) findViewById(R.id.version); textViewVersion.setText(message); new GcmRegistrationAsyncTask().execute(this); } }