PackageManager.getApplicationLabel
Code IndexAdd Codota to your IDE (free)

Best code snippets using android.content.pm.PackageManager.getApplicationLabel(Showing top 15 results out of 315)

  • Common ways to obtain PackageManager
private void myMethod () {
PackageManager p =
  • Context context;context.getPackageManager()
  • AI code suggestions by Codota
}
origin: stackoverflow.com

 final PackageManager pm = getApplicationContext().getPackageManager();
ApplicationInfo ai;
try {
  ai = pm.getApplicationInfo( this.getPackageName(), 0);
} catch (final NameNotFoundException e) {
  ai = null;
}
final String applicationName = (String) (ai != null ? pm.getApplicationLabel(ai) : "(unknown)");
origin: stackoverflow.com

 public String getAppLable(Context context) {
  PackageManager packageManager = context.getPackageManager();
  ApplicationInfo applicationInfo = null;
  try {
    applicationInfo = packageManager.getApplicationInfo(context.getApplicationInfo().packageName, 0);
  } catch (final NameNotFoundException e) {
  }
  return (String) (applicationInfo != null ? packageManager.getApplicationLabel(applicationInfo) : "Unknown");
}
origin: stackoverflow.com

 ActivityManager am = (ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
List l = am.getRunningAppProcesses();
Iterator i = l.iterator();
PackageManager pm = this.getPackageManager();
while(i.hasNext()) {
 ActivityManager.RunningAppProcessInfo info = (ActivityManager.RunningAppProcessInfo)(i.next());
 try {
  CharSequence c = pm.getApplicationLabel(pm.getApplicationInfo(info.processName, PackageManager.GET_META_DATA));
  Log.w("LABEL", c.toString());
 }catch(Exception e) {
  //Name Not FOund Exception
 }
}
origin: stackoverflow.com

 PackageManager pm = getPackageManager();
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
for(ApplicationInfo packageInfo:packages){
  if( pm.getLaunchIntentForPackage(packageInfo.packageName) != null ){
        String currAppName = pm.getApplicationLabel(packageInfo).toString();
        //This app is a non-system app
  }
  else{
    //System App
  }
}
origin: stackoverflow.com

PackageManager pm=this.getPackageManager();
 List<ApplicationInfo> list=pm.getInstalledApplications(0);
 setContentView(R.layout.activity_sec);    ///call this Line here
 ListView lv=(ListView)findViewById(R.id.listView1);
 ArrayList<String> al=new ArrayList<String>();
 for(ApplicationInfo app:list)
 {
   String appN=pm.getApplicationLabel(app).toString();
   al.add(appN);
 }
 ArrayAdapter<String> arr=new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,android.R.id.text1,al);
 lv.setAdapter(arr);
origin: stackoverflow.com

public String applicationLabel(Context con,ApplicationInfo info){
   PackageManager p = con.getPackageManager();
   String label = p.getApplicationLabel(info).toString();
   return label;
 }
origin: stackoverflow.com

PackageManager pm = getPackageManager();
 List<ApplicationInfo> packages = pm
     .getInstalledApplications(PackageManager.GET_META_DATA);
 for (ApplicationInfo packageInfo : packages) {
   // returns the package name
    packageInfo.packageName;
    // returns the application name
   pm.getApplicationLabel(packageInfo).toString();
   // returns the last installation time
   pm.getPackageInfo(packageInfo.packageName, 0).firstInstallTime;
 }
origin: stackoverflow.com

 private String getApplicationName(Context context, String data, int flag) {

  final PackageManager pckManager = context.getPackageManager();
  ApplicationInfo applicationInformation;
  try {
    applicationInformation = pckManager.getApplicationInfo(data, flag);
  } catch (PackageManager.NameNotFoundException e) {
    applicationInformation = null;
  }
  final String applicationName = (String) (applicationInformation != null ? pckManager.getApplicationLabel(applicationInformation) : "(unknown)");
  return applicationName;

}
origin: stackoverflow.com

 final PackageManager pm = getApplicationContext().getPackageManager();
ApplicationInfo ai;
try {
  ai = pm.getApplicationInfo(PackageName, 0);
} catch (final NameNotFoundException e) {
  ai = null;
}
final String applicationName = (String) (ai != null ? pm.getApplicationLabel(ai) : "(unknown)");
System.out.println("Application name : "+applicationName);
origin: stackoverflow.com

 final PackageManager pm = getPackageManager ();
List< ApplicationInfo > packages = pm.getInstalledApplications ( PackageManager.GET_META_DATA );

View inflate = getLayoutInflater(). inflate(R. layout. anwendung_starten_layout, null);

String applicationName = null;
String packetName = null;

for ( ApplicationInfo packageInfo : packages ) {
  applicationName = pm.getApplicationLabel(packageInfo);
  packetName = packageInfo.packageName;
  kinder.add ( packetName );
}
origin: stackoverflow.com

 PackageManager pm = this.getPackageManager(); //assuming you're running from an activity
                       //use a context otherwise
ApplicationInfo appInfo = pm.getApplicationInfo(values.get(position).processName, PackageManager.GET_META_DATA);
String appName = pm.getApplicationLabel(appInfo).toString();
appName.setText(appName);
origin: stackoverflow.com

 PackageManager pm = getPackageManager();
List<ApplicationInfo> packages = pm.getInstalledApplications(PackageManager.GET_META_DATA);
for(ApplicationInfo packageInfo:packages){
  if( pm.getLaunchIntentForPackage(packageInfo.packageName) != null ){
        String currAppName = pm.getApplicationLabel(packageInfo).toString();
        //This app is a non-system app
  }
  else{
    //System App
  }
}
origin: stackoverflow.com

 PackageManager packageManager = context.getPackageManager();
ApplicationInfo applicationInfo = null;
try {
  applicationInfo = packageManager.getApplicationInfo(packageName, 0);
} catch (final NameNotFoundException e) {}
final String title = (String)((applicationInfo != null) ? packageManager.getApplicationLabel(applicationInfo) : "???");
origin: stackoverflow.com

private String getApplicationName(Context context, String data, int flag) {
   final PackageManager pckManager = context.getPackageManager();
   ApplicationInfo applicationInformation;
   try {
     applicationInformation = pckManager.getApplicationInfo(data, flag);
   } catch (PackageManager.NameNotFoundException e) {
     applicationInformation = null;
   }
   final String applicationName = (String) (applicationInformation != null ? pckManager.getApplicationLabel(applicationInformation) : "(unknown)");
   return applicationName;
 }
origin: stackoverflow.com

 final PackageManager pkgmgr = getApplicationContext().getPackageManager();
ApplicationInfo appinfo;
try {
  appinfo = pkgmgr.getApplicationInfo( this.getPackageName(), 0);
} catch (final NameNotFoundException e) {
  appinfo = null;
}
final String applicationName = (String) (appinfo != null ? pkgmgr.getApplicationLabel(appinfo) : "(unknown)");
android.content.pmPackageManagergetApplicationLabel

Popular methods of PackageManager

  • getPackageInfo
  • getActivityInfo
  • getApplicationInfo
  • resolveActivity
  • getActivityIcon
  • getApplicationIcon
  • getResourcesForApplication
  • hasSystemFeature
  • queryIntentActivities
  • getDefaultActivityIcon
  • getDrawable
  • queryIntentActivityOptions
  • getDrawable,
  • queryIntentActivityOptions,
  • addPreferredActivity,
  • checkPermission,
  • checkSignatures,
  • clearPackagePreferredActivities,
  • getActivityLogo,
  • getComponentEnabledSetting,
  • getInstalledApplications

Popular classes and methods

  • setContentView (Activity)
  • compareTo (BigDecimal)
    Compares this BigDecimal with val. Returns one of the three values 1, 0, or -1. The method behaves a
  • startActivity (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java virtua
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)