diff options
author | lado <herrlado@gmail.com> | 2011-10-31 16:33:29 +0100 |
---|---|---|
committer | lado <herrlado@gmail.com> | 2011-10-31 16:33:29 +0100 |
commit | f03abe3091a9b1ec214876b8192ba620a25c634b (patch) | |
tree | 0e04ae98830e13e43c93686447d3e65dd9157a08 /vdrmanager/src/de | |
parent | 2b2f4f2e63b98b0ea4b3514a1a4fe585b72e07a5 (diff) | |
download | vdr-manager-f03abe3091a9b1ec214876b8192ba620a25c634b.tar.gz vdr-manager-f03abe3091a9b1ec214876b8192ba620a25c634b.tar.bz2 |
getPackageInfo added
Diffstat (limited to 'vdrmanager/src/de')
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/gui/Utils.java | 16 |
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; + } + } |