|
@@ -2,6 +2,8 @@ package de.tudarmstadt.informatik.hostage.ui2.fragment;
|
|
|
|
|
|
import android.app.Activity;
|
|
|
import android.app.Fragment;
|
|
|
+import android.content.pm.PackageInfo;
|
|
|
+import android.content.pm.PackageManager;
|
|
|
import android.os.Bundle;
|
|
|
import android.text.method.LinkMovementMethod;
|
|
|
import android.view.LayoutInflater;
|
|
@@ -9,6 +11,7 @@ import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
+import de.tudarmstadt.informatik.hostage.Hostage;
|
|
|
import de.tudarmstadt.informatik.hostage.R;
|
|
|
|
|
|
/**
|
|
@@ -27,10 +30,22 @@ public class AboutFragment extends Fragment {
|
|
|
}
|
|
|
|
|
|
View rootView = inflater.inflate(R.layout.fragment_about, container, false);
|
|
|
-
|
|
|
- TextView hostage = (TextView) rootView.findViewById(R.id.hostage);
|
|
|
+ PackageManager manager = Hostage.getContext().getPackageManager();
|
|
|
+ PackageInfo info = null;
|
|
|
+ try {
|
|
|
+ info = manager.getPackageInfo(Hostage.getContext().getPackageName(), 0);
|
|
|
+ } catch (PackageManager.NameNotFoundException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ String versionApp;
|
|
|
+ versionApp = info.versionName;
|
|
|
+
|
|
|
+ TextView hostage = (TextView) rootView.findViewById(R.id.hostage);
|
|
|
+ TextView version = (TextView) rootView.findViewById(R.id.hostageVersion);
|
|
|
+
|
|
|
+ version.setText("ver. "+versionApp);
|
|
|
hostage.setMovementMethod(LinkMovementMethod.getInstance());
|
|
|
-
|
|
|
+ version.setMovementMethod(LinkMovementMethod.getInstance());
|
|
|
|
|
|
return rootView;
|
|
|
}
|