congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ResolveInfo.loadLabel
Code IndexAdd Tabnine to your IDE (free)

How to use
loadLabel
method
in
android.content.pm.ResolveInfo

Best Java code snippets using android.content.pm.ResolveInfo.loadLabel (Showing top 20 results out of 639)

origin: prolificinteractive/material-calendarview

@Override
public void onBindViewHolder(ResolveInfoViewHolder viewHolder, int i) {
 ResolveInfo item = samples.get(i);
 viewHolder.textView.setText(item.loadLabel(pm));
}
origin: stackoverflow.com

intentList.add(new LabeledIntent(intent, packageName, ri.loadLabel(pm), ri.icon));
origin: Flipboard/bottomsheet

public Adapter(Context context, Intent intent, List<ActivityInfo> mixins) {
  inflater = LayoutInflater.from(context);
  packageManager = context.getPackageManager();
  List<ResolveInfo> infos = packageManager.queryIntentActivities(intent, 0);
  activityInfos = new ArrayList<>(infos.size() + mixins.size());
  activityInfos.addAll(mixins);
  for (ResolveInfo info : infos) {
    ComponentName componentName = new ComponentName(info.activityInfo.packageName, info.activityInfo.name);
    ActivityInfo activityInfo = new ActivityInfo(info, info.loadLabel(packageManager), componentName);
    if (filter.include(activityInfo)) {
      activityInfos.add(activityInfo);
    }
  }
  Collections.sort(activityInfos, sortMethod);
}
origin: commonsguy/cw-omnibus

 private void bindView(int position, View row) {
  TextView label=(TextView)row.findViewById(R.id.label);
  
  label.setText(getItem(position).loadLabel(pm));
  
  ImageView icon=(ImageView)row.findViewById(R.id.icon);
  
  icon.setImageDrawable(getItem(position).loadIcon(pm));
 }
}
origin: commonsguy/cw-omnibus

 private void bindView(int position, View row) {
  TextView label=(TextView)row.findViewById(R.id.label);
  
  label.setText(getItem(position).loadLabel(pm));
  
  ImageView icon=(ImageView)row.findViewById(R.id.icon);
  
  icon.setImageDrawable(getItem(position).loadIcon(pm));
 }
}
origin: commonsguy/cw-omnibus

 private void bindView(int position, View row) {
  TextView label=(TextView)row.findViewById(R.id.label);
  
  label.setText(getItem(position).loadLabel(pm));
  
  ImageView icon=(ImageView)row.findViewById(R.id.icon);
  
  icon.setImageDrawable(getItem(position).loadIcon(pm));
 }
}
origin: commonsguy/cw-omnibus

 private void bindView(int position, View row) {
  TextView label=(TextView)row.findViewById(R.id.label);
  
  label.setText(getItem(position).loadLabel(pm));
  
  ImageView icon=(ImageView)row.findViewById(R.id.icon);
  
  icon.setImageDrawable(getItem(position).loadIcon(pm));
 }
}
origin: stackoverflow.com

 PackageManager pm = kyoPrint.getPackageManager();
Intent viewIntent = new Intent(Intent.ACTION_VIEW);
Intent editIntent = new Intent(Intent.ACTION_EDIT);
viewIntent.setDataAndType(uri, type);
editIntent.setDataAndType(uri, type);
Intent openInChooser = Intent.createChooser(viewIntent, "Open in...");

// Append " (for editing)" to applicable apps, otherwise they will show up twice identically
Spannable forEditing = new SpannableString(" (for editing)");
forEditing.setSpan(new ForegroundColorSpan(Color.CYAN), 0, forEditing.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
List<ResolveInfo> resInfo = pm.queryIntentActivities(editIntent, 0);
Intent[] extraIntents = new Intent[resInfo.size()];
for (int i = 0; i < resInfo.size(); i++) {
  // Extract the label, append it, and repackage it in a LabeledIntent
  ResolveInfo ri = resInfo.get(i);
  String packageName = ri.activityInfo.packageName;
  Intent intent = new Intent();
  intent.setComponent(new ComponentName(packageName, ri.activityInfo.name));
  intent.setAction(Intent.ACTION_EDIT);
  intent.setDataAndType(uri, type);
  CharSequence label = TextUtils.concat(ri.loadLabel(pm), forEditing);
  extraIntents[i] = new LabeledIntent(intent, packageName, label, ri.icon);
}

openInChooser.putExtra(Intent.EXTRA_INITIAL_INTENTS, extraIntents);
startActivity(openInChooser);
origin: commonsguy/cw-omnibus

 @Override
 public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);

  PackageManager mgr=getPackageManager();
  Intent i=
    new Intent(Intent.ACTION_VIEW,
          Uri.parse("https://commonsware.com"));
  ResolveInfo ri=
    mgr.resolveActivity(i, PackageManager.MATCH_DEFAULT_ONLY);

  Toast.makeText(this, ri.loadLabel(mgr), Toast.LENGTH_LONG).show();
  
  startActivity(i);
  finish();
 }
}
origin: ZieIony/Carbon

@Override
public int addIntentOptions(int group, int id, int categoryOrder, ComponentName caller,
              Intent[] specifics, Intent intent, int flags, android.view.MenuItem[] outSpecificItems) {
  PackageManager pm = mContext.getPackageManager();
  final List<ResolveInfo> lri =
      pm.queryIntentActivityOptions(caller, specifics, intent, 0);
  final int N = lri != null ? lri.size() : 0;
  if ((flags & FLAG_APPEND_TO_GROUP) == 0) {
    removeGroup(group);
  }
  for (int i = 0; i < N; i++) {
    final ResolveInfo ri = lri.get(i);
    Intent rintent = new Intent(
        ri.specificIndex < 0 ? intent : specifics[ri.specificIndex]);
    rintent.setComponent(new ComponentName(
        ri.activityInfo.applicationInfo.packageName,
        ri.activityInfo.name));
    final android.view.MenuItem item = add(group, id, categoryOrder, ri.loadLabel(pm))
        .setIcon(ri.loadIcon(pm))
        .setIntent(rintent);
    if (outSpecificItems != null && ri.specificIndex >= 0) {
      outSpecificItems[ri.specificIndex] = item;
    }
  }
  return N;
}
origin: robolectric/robolectric

 @Test
 public void testNewResolveInfoWithActivity() {
  assertThat(mResolveInfo.loadLabel(null).toString()).isEqualTo("name");
  assertThat(mResolveInfo.activityInfo.packageName).isEqualTo("package");
  assertThat(mResolveInfo.activityInfo.applicationInfo.packageName).isEqualTo("package");
  assertThat(mResolveInfo.activityInfo.name).isEqualTo("fragmentActivity");
 }
}
origin: joyoyao/superCleanMaster

if (resolveInfoList.size() > 0) {
  appName = resolveInfoList.get(0).loadLabel(pm).toString();
  packageReceiver = resolveInfoList.get(0).activityInfo.packageName + "/" + resolveInfoList.get(0).activityInfo.name;
  icon = resolveInfoList.get(0).loadIcon(pm);
    if (appName.equals(resolveInfoList.get(i).loadLabel(pm).toString())) {
      packageReceiver = packageReceiver + ";" + resolveInfoList.get(i).activityInfo.packageName + "/" + resolveInfoList.get(i).activityInfo.name;
    } else {
      appName = resolveInfoList.get(i).loadLabel(pm).toString();
      packageReceiver = resolveInfoList.get(i).activityInfo.packageName + "/" + resolveInfoList.get(i).activityInfo.name;
      icon = resolveInfoList.get(i).loadIcon(pm);
origin: android-hacker/VirtualXposed

        ri.loadLabel(getPackageManager()), null, ii));
CharSequence r0Label = r0.loadLabel(mPm);
mShowExtended = false;
for (int i = 1; i < N; i++) {
  CharSequence riLabel = ri.loadLabel(mPm);
  if (riLabel == null) {
    riLabel = ri.activityInfo.packageName;
origin: stackoverflow.com

Log.v("file--", " "+f1.getName().toString()+"----"+info.loadLabel(getPackageManager()));
  try{
    String file_name = info.loadLabel(getPackageManager()).toString();
    Log.d("file_name--", " "+file_name);
origin: GeekGhost/Ghost

/**
 * 获取系统安装的APP应用
 *
 * @param context
 */
public static ArrayList<AppInfo> getAllApp(Context context) {
  PackageManager manager = context.getPackageManager();
  Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
  mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
  List<ResolveInfo> apps = manager.queryIntentActivities(mainIntent, 0);
  // 将获取到的APP的信息按名字进行排序
  Collections.sort(apps, new ResolveInfo.DisplayNameComparator(manager));
  ArrayList<AppInfo> appList = new ArrayList<AppInfo>();
  for (ResolveInfo info : apps) {
    AppInfo appInfo = new AppInfo();
    appInfo.setAppLable(info.loadLabel(manager) + "");
    appInfo.setAppIcon(info.loadIcon(manager));
    appInfo.setAppPackage(info.activityInfo.packageName);
    appInfo.setAppClass(info.activityInfo.name);
    appList.add(appInfo);
    System.out.println("info.activityInfo.packageName=" + info.activityInfo.packageName);
    System.out.println("info.activityInfo.name=" + info.activityInfo.name);
  }
  return appList;
}
origin: stackoverflow.com

hendler.textLable.setText(info.loadLabel(getPackageManager()));
origin: GeekGhost/Ghost

/**
 * 获取用户安装的APP应用
 *
 * @param context
 */
public static ArrayList<AppInfo> getUserApp(Context context) {
  PackageManager manager = context.getPackageManager();
  Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
  mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
  List<ResolveInfo> apps = manager.queryIntentActivities(mainIntent, 0);
  // 将获取到的APP的信息按名字进行排序
  Collections.sort(apps, new ResolveInfo.DisplayNameComparator(manager));
  ArrayList<AppInfo> appList = new ArrayList<AppInfo>();
  for (ResolveInfo info : apps) {
    AppInfo appInfo = new AppInfo();
    ApplicationInfo ainfo = info.activityInfo.applicationInfo;
    if ((ainfo.flags & ApplicationInfo.FLAG_SYSTEM) <= 0) {
      appInfo.setAppLable(info.loadLabel(manager) + "");
      appInfo.setAppIcon(info.loadIcon(manager));
      appInfo.setAppPackage(info.activityInfo.packageName);
      appInfo.setAppClass(info.activityInfo.name);
      appList.add(appInfo);
    }
  }
  return appList;
}
origin: Neamar/KISS

AppPojo app = new AppPojo(id, appInfo.packageName, info.activityInfo.name, new UserHandle());
app.setName(info.loadLabel(manager).toString());
origin: fookwood/Launcher3

  public int compare(ResolveInfo info1, ResolveInfo info2) {
    return mCollator.compare(info1.loadLabel(packageManager),
        info2.loadLabel(packageManager));
  }
});
origin: fookwood/Launcher3

/**
 * Apply the resolve info to the view.
 */
public void applyFromResolveInfo(
    PackageManager pm, ResolveInfo info, WidgetPreviewLoader loader) {
  mInfo = info;
  CharSequence label = info.loadLabel(pm);
  mWidgetName.setText(label);
  mWidgetDims.setText(String.format(mDimensionsFormatString, 1, 1));
  mWidgetPreviewLoader = loader;
}
android.content.pmResolveInfoloadLabel

Popular methods of ResolveInfo

  • loadIcon
  • <init>
  • getIconResource
  • toString
  • getClass
  • writeToParcel

Popular in Java

  • Reactive rest calls using spring rest template
  • requestLocationUpdates (LocationManager)
  • getExternalFilesDir (Context)
  • setContentView (Activity)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • JList (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now