diff options
Diffstat (limited to 'src/de/blinkt/openvpn/AboutFragment.java')
-rw-r--r-- | src/de/blinkt/openvpn/AboutFragment.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/de/blinkt/openvpn/AboutFragment.java b/src/de/blinkt/openvpn/AboutFragment.java index c96c5833..065e53bc 100644 --- a/src/de/blinkt/openvpn/AboutFragment.java +++ b/src/de/blinkt/openvpn/AboutFragment.java @@ -1,10 +1,12 @@ package de.blinkt.openvpn; import android.app.Fragment; +import android.content.pm.PackageManager.NameNotFoundException; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; +import android.widget.TextView; public class AboutFragment extends Fragment { @@ -18,6 +20,17 @@ public class AboutFragment extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v= inflater.inflate(R.layout.about, container, false); + TextView ver = (TextView) v.findViewById(R.id.version); + + String version; + try { + version = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0).versionName; + } catch (NameNotFoundException e) { + version = "error fetching version"; + } + + + ver.setText(getString(R.string.version_info,version)); return v; } |