Android Open Source - DrPermissions Application List Adapter

From Project

Back to project page DrPermissions.


The source code is released under:

Apache License

If you think the Android project DrPermissions listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package ir.smartlab.permissions;
//from ww w.  ja v a2  s  .  com
import java.util.List;
import ir.smartlab.permissions.R;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class ApplicationListAdapter extends BaseAdapter {
  private final Activity activity;
  private final List<ApplicationListItem> items;
  public ApplicationListAdapter(Activity activity, List<ApplicationListItem> items) {
    this.activity = activity;
    this.items = items;

  public int getCount() {
    return items.size();

  public ApplicationListItem getItem(int position) {
    return items.get(position);

  public long getItemId(int position) {
    return items.get(position).getId();

  public View getView(int position, View convertView, ViewGroup parent) {
    if (convertView == null) {
      LayoutInflater layoutInflater = activity.getLayoutInflater();
      convertView = layoutInflater.inflate(R.layout.application_list_item, null);
    TextView textViewName = (TextView)convertView.findViewById(;
    ImageView imageView = (ImageView)convertView.findViewById(;
    return convertView;


Java Source Code List