From f21a50e947a6857c1e680e41c2a5acc38479441a Mon Sep 17 00:00:00 2001 From: lado Date: Mon, 31 Oct 2011 23:20:54 +0100 Subject: about tool --- .../src/de/bjusystems/vdrmanager/gui/About.java | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 vdrmanager/src/de/bjusystems/vdrmanager/gui/About.java (limited to 'vdrmanager/src/de') diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/About.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/About.java new file mode 100644 index 0000000..eb6252c --- /dev/null +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/About.java @@ -0,0 +1,33 @@ +package de.bjusystems.vdrmanager.gui; + +import de.bjusystems.vdrmanager.R; +import android.app.Activity; +import android.app.AlertDialog; +import android.content.pm.PackageInfo; +import android.text.SpannableString; +import android.text.util.Linkify; + +public class About { + + static AlertDialog about = null; + + public static void show(Activity activity){ + if(about == null){ + String vi = ""; + PackageInfo pi = Utils.getPackageInfo(activity); + if(pi != null){ + vi = "v"+pi.versionName; + } + //View view = activity.getLayoutInflater().inflate(R.layout.about, null); + final SpannableString s = new SpannableString(activity.getString(R.string.about_text,vi)); + Linkify.addLinks(s, Linkify.ALL); + about = new AlertDialog.Builder(activity) + .setTitle(R.string.about_title) + .setMessage(s) + .setPositiveButton(android.R.string.ok, null) + .setCancelable(false) + .create(); + } + about.show(); + } +} -- cgit v1.2.3