logo
Tags down

shadow

How to get the icon of other applications (Android)


By : Willem.vanDuijn
Date : October 15 2020, 11:12 AM
Any of those help Ok, I figured out how to do it. In case your curious this is what I did.
code :


Share : facebook icon twitter icon

Make android app icon available to other applications


By : user1705235
Date : March 29 2020, 07:55 AM
Any of those help Seems it was a caching issue. I re-flashed my phone today for an update and the correct Icon was shown using the same APK as I was using when it wasn't showing. Maybe a clear data on the displaying app was all that was required!

How to show applications icon in listview in Android?


By : naresh
Date : March 29 2020, 07:55 AM
wish of those help I did a program to filter user applications and system application, show it into a listview, the code is Ok but I wanna add apps icon before the name of each apps, here is my code, please everybody help me! , You are not trying to get the application icon . Try this code
code :
  private PackageManager pk;
  pk = getPackageManager();
  ....
  pk.getApplicationIcon(process.get(i).processName)

how to get running applications icon on android programmatically


By : Jonyy
Date : March 29 2020, 07:55 AM
I wish did fix the issue. Below here is my code but i am getting default android launcher icon for all running applications: , just replace this line
code :
ico = pm.getApplicationIcon(pName);
ico = getApplicationInfo().loadIcon(getPackageManager()); 
public void getAllICONS() {

    PackageManager pm = getPackageManager();

    ActivityManager am1 = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);

    List<RunningTaskInfo> processes = am1
            .getRunningTasks(Integer.MAX_VALUE);

    if (processes != null) {
        for (int k = 0; k < 5; k++) {
            // String pkgName = app.getPackageName();
            String packageName = processes.get(k).topActivity
                    .getPackageName();
            Log.e("packageName-->", "" + packageName);
            Drawable ico = null;
            try {
                String pName = (String) pm.getApplicationLabel(pm
                        .getApplicationInfo(packageName,
                                PackageManager.GET_META_DATA));
                name.add("" + pName);
                ApplicationInfo a = pm.getApplicationInfo(packageName,
                        PackageManager.GET_META_DATA);
                ico = getPackageManager().getApplicationIcon(
                        processes.get(k).topActivity.getPackageName());
                getPackageManager();
                Log.e("ico-->", "" + ico);

            } catch (NameNotFoundException e) {
                Log.e("ERROR", "Unable to find icon for package '"
                        + packageName + "': " + e.getMessage());
            }
            // icons.put(processes.get(k).topActivity.getPackageName(),ico);
            icons.add(ico);

        }
    }
}

How to list all installed applications with icon and check box in android


By : Fatih Erkan
Date : March 29 2020, 07:55 AM
I hope this helps . The reason why this happens is because your views are being re-used but you do not reset the state of the checkbox in the getView.
I suggest you do something like this:
code :
import java.util.List;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
private List<ApplicationInfo> appsList = null;
private Context context;
private PackageManager packageManager;
private ArrayList<Boolean> checkList = new ArrayList<Boolean>();

public ApplicationAdapter(Context context, int textViewResourceId,
        List<ApplicationInfo> appsList) {
    super(context, textViewResourceId, appsList);
    this.context = context;
    this.appsList = appsList;
    packageManager = context.getPackageManager();

    for (int i = 0; i < appsList.size(); i++) {
        checkList.add(false);
    }
}

@Override
public int getCount() {
    return ((null != appsList) ? appsList.size() : 0);
}

@Override
public ApplicationInfo getItem(int position) {
    return ((null != appsList) ? appsList.get(position) : null);
}

@Override
public long getItemId(int position) {
    return position;
}

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    View view = convertView;
    if (null == view) {
        LayoutInflater layoutInflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        view = layoutInflater.inflate(R.layout.row, null);
    }

    ApplicationInfo data = appsList.get(position);
    if (null != data) {
        TextView appName = (TextView) view.findViewById(R.id.app_name);
        TextView packageName = (TextView) view.findViewById(R.id.app_paackage);
        ImageView iconview = (ImageView) view.findViewById(R.id.app_icon);

        CheckBox checkBox = (CheckBox) view.findViewById(R.id.cb_app);
        checkBox.setTag(Integer.valueOf(position)); // set the tag so we can identify the correct row in the listener
        checkBox.setChecked(checkList.get(position); // set the status as we stored it        
        checkBox.setOnCheckedChangeListener(mListener); // set the listener

        appName.setText(data.loadLabel(packageManager));
        packageName.setText(data.packageName);
        iconview.setImageDrawable(data.loadIcon(packageManager));
    }
    return view;
}

OnCheckedChangeListener mListener = new OnCheckedChangeListener() {

     public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {   
         checkList.set((Integer)buttonView.getTag(),isChecked); // get the tag so we know the row and store the status 
     }
};
}

Get the name, icon and package name of all the installed applications in android


By : Murat TC Tokgozlu
Date : March 29 2020, 07:55 AM
wish help you to fix your issue I want to be able to get the string package name and icon of all the applications installed in my phone. What I have done: Browsed and found this solution , Please use the below code and directions:
code :
//check this code with some hard work then you will rock
 List<PackageInfo> apps = getPackageManager().getInstalledPackages(0);

    ArrayList<AppInfo> res = new ArrayList<AppInfo>();
    for(int i=0;i<apps.size();i++) {
                    PackageInfo p = apps.get(i);

                    AppInfo newInfo = new AppInfo();
                    newInfo.appname = p.applicationInfo.loadLabel(getPackageManager()).toString();
                    newInfo.pname = p.packageName;
                    newInfo.versionName = p.versionName;
                    newInfo.versionCode = p.versionCode;
                    newInfo.icon = p.applicationInfo.loadIcon(getPackageManager());
                    res.add(newInfo);
                    }
                }

    class AppInfo {
        String appname = "";
        String pname = "";
        String versionName = "";
        int versionCode = 0;
        Drawable icon;

    }
Related Posts Related Posts :
  • GWT DatePicker Locale
  • How would you design a twitter like message system, how to design the messaging system?
  • Is there a robust java.util.logging handler implementation of syslog?
  • Aligning messageformat on printing a JTable
  • SXXP0003: Error reported by XML parser: Content is not allowed in prolog
  • ehcache LRU evicting recently used entries
  • java cosine similarity problem
  • Efficient way to implement a client multiple file upload service
  • Regarding Object Comparison
  • How to embed IE in Swing application?
  • Using javax.tools.ToolProvider from a custom classloader?
  • What is the difference between i++ & ++i in a for loop?
  • Match a java main class with regexp
  • Confluence Persistence
  • Is there a way for a SecurityManager in java to selectively grant ReflectPermission("suppressAccessChecks")?
  • Using the camera activity in Android
  • Is communication in java rmi secure?
  • Java - how to make "runnable" JTable?
  • How can I write a Java program to draw a box, an oval, and an arrow?
  • What is the difference between ServletRequest's getRemoteHost() and getServerName()
  • java sparse matrix problem
  • ClassCastException when using HQL
  • how to generate a csv file through java code
  • Netbeans + tomcat on Ubuntu
  • How to connect to a remote MySQL database with Java?
  • System Event Handling using Java
  • How to change Ant script with EMMA code-coverage so it can find runtime coverage data?
  • Java bytecode iconst_0 iadd sequence
  • get the size of a list in a property
  • I want to convert a resultset to a string. I have tried everything but it always gives no data found. Please provide som
  • How can i sort java JTable with an empty Row and force the Empty row always be last?
  • How can I mount network drive in Mac OS X on Java?
  • XStream: How do I map xml mixed attributes and elements to POJOs?
  • begin with java voip
  • java: Preferences API vs. Apache Commons Configuration
  • Howto distinguish Application Quit from System Shutdown
  • How to go about with real GUI development with Java Swing and MVC
  • VB support in Java 6?
  • How to use jar files without package information?
  • how to inherit Constructor from super class to sub class
  • Multidimensional arrays in Java extends which class?
  • Connect to ibm mq with jms . Specify the channel and queue manager
  • Accessing the implicit objects from a JSP EL function
  • Find current heap size with jmap
  • Why doesn't Java have compound assignment versions of the conditional-and and conditional-or operators? (&&=, ||
  • What is the best way to manage configuration data
  • commons fileUpload: specifying an upload directory within Webapplication context
  • ModelAttributes not accessible on jsp
  • Session management between thick client and server?
  • Oracle JDBC intermittent Connection Issue
  • No mapping for LONGVARCHAR in Hibernate 3.2
  • A Packet Blocker Software
  • Anyone using Django in the "Enterprise"
  • Memory leak during repeated lucene query searches?
  • First steps developing in java applet. Directions
  • java efficient de-duplication
  • Converting sequential Java to concurrent java code
  • Java variable number or arguments for a method
  • when developing locally, does it make a difference if the context is '/' or '/appname/'?
  • Problem using JUnit4TestAdapter from eclipse plugin context
  • shadow
    Privacy Policy - Terms - Contact Us © bighow.org