summaryrefslogtreecommitdiff
path: root/vdrmanager
diff options
context:
space:
mode:
authorlado <herrlado@gmail.com>2011-10-31 16:33:29 +0100
committerlado <herrlado@gmail.com>2011-10-31 16:33:29 +0100
commitf03abe3091a9b1ec214876b8192ba620a25c634b (patch)
tree0e04ae98830e13e43c93686447d3e65dd9157a08 /vdrmanager
parent2b2f4f2e63b98b0ea4b3514a1a4fe585b72e07a5 (diff)
downloadvdr-manager-f03abe3091a9b1ec214876b8192ba620a25c634b.tar.gz
vdr-manager-f03abe3091a9b1ec214876b8192ba620a25c634b.tar.bz2
getPackageInfo added
Diffstat (limited to 'vdrmanager')
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java
index fef4108..f22b4e3 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java
@@ -6,8 +6,11 @@ import java.util.List;
import android.app.Activity;
import android.app.AlertDialog;
+import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
import android.graphics.Color;
import android.net.Uri;
import android.text.Spannable;
@@ -210,5 +213,18 @@ public class Utils {
}
return src.replace(C.DATA_SEPARATOR, "|##").replace("\n", "||#");
}
+
+
+ public static PackageInfo getPackageInfo(Context ctx) {
+ PackageInfo pi = null;
+ try {
+ pi = ctx.getPackageManager().getPackageInfo(
+ ctx.getPackageName(), PackageManager.GET_ACTIVITIES);
+ } catch (PackageManager.NameNotFoundException e) {
+ e.printStackTrace();
+ }
+ return pi;
+ }
+
}