From f03abe3091a9b1ec214876b8192ba620a25c634b Mon Sep 17 00:00:00 2001 From: lado Date: Mon, 31 Oct 2011 16:33:29 +0100 Subject: getPackageInfo added --- vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'vdrmanager/src/de') 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; + } + } -- cgit v1.2.3