title: Display version name
body: <p>I want to display the versionName ( number) located in the android manifest on my spalsh screen. I found some example codes but they are not working. This seems like a simple task but it does not display for me</p>
  
  <p>text view from splash xml:</p>
  
  <pre><code>   &lt;TextView
          android:id="@+id/ver_name"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentBottom="true"
          android:layout_alignParentRight="true"
          android:layout_marginBottom="33dp"
          android:layout_marginRight="30dp"
          android:text=" " /&gt;
  </code></pre>
  
  <p>display method:</p>
  
  <pre><code>    private void displayVersionName() {
      String versionName = "";
      PackageInfo packageInfo;
      try {
          packageInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
          versionName = "ver:" + packageInfo.versionName;
      } catch (NameNotFoundException e) {
          e.printStackTrace();
      }
      TextView tv = (TextView) findViewById(R.id.ver_name);
      tv.setText(versionName);
    }
  </code></pre>