summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/AboutActivity.java
blob: 6c4e517b1f1c67ff5cb3f87cd91007c8d1e84d9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package se.leap.bitmaskclient;

import android.app.Activity;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.widget.TextView;

public class AboutActivity extends Activity  {
	
    final public static String TAG = "aboutFragment";
    final public static int VIEWED = 0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
    	setContentView(R.layout.about);
    	TextView ver = (TextView) findViewById(R.id.version);
    	
    	String version;
    	String name="Openvpn";
		try {
			PackageInfo packageinfo = getPackageManager().getPackageInfo(getPackageName(), 0);
			version = packageinfo.versionName;
			name = getString(R.string.app);
		} catch (NameNotFoundException e) {
			version = "error fetching version";
		}

    	
    	ver.setText(getString(R.string.version_info,name,version));
    	setResult(VIEWED);
    }

}