I referred to these links link , link , link , link
but my problem is not resolved. I know there are many questions regarding this problem, but my problem
I have grade 4 A, B, C, D
From class A, I goto class B, where all installed applications are listed. in class B, send Packagelist to class c (BaseAdapter class) and then the user who selected the user will go to class A.
So my problem is where and how can I use the POJO class to transfer installed applications to the baseadapter class, and then how can I get all the checked value (application string name) and pass it to class A. as well as how I can support checked flag status.
any help plz.
custom adapter class
import java.util.List; import android.app.Activity; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.View.OnClickListener; import android.widget.BaseAdapter; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.TextView; import android.widget.Toast; public class AppListAdapter extends BaseAdapter { List<PackageInfo> packageList; Activity context; PackageManager packageManager; boolean[] itemChecked; int checkBoxCounter = 0; int checkBoxInitialized = 0; public AppListAdapter(Activity context, List<PackageInfo> packageList, PackageManager packageManager) { super(); this.context = context; this.packageList = packageList; this.packageManager = packageManager; itemChecked = new boolean[packageList.size()]; } private class ViewHolder { TextView apkName; CheckBox ck1; } public int getCount() { return packageList.size(); } public Object getItem(int position) { return packageList.get(position); } public long getItemId(int position) { return 0; } @Override public View getView(final int position, View convertView, ViewGroup parent) {
source share