i am trying to make launcher. i have have displayed the custom list with app_label,icon,package_name and check box. now i want to save selected app_name in shared preferences. i m not getting how to go through it. kindly help.
here is my code:
adapter = new ArrayAdapter<AppDetail>(MainActivity.this,
android.R.layout.simple_list_item_multiple_choice, apps) {
@Override
public View getView(int position, View convertView,
ViewGroup parent) {
View row = convertView;
if (row == null) {
convertView = getLayoutInflater().inflate( R.layout.list_item,parent,false);
}
// check_checkbox();
k=apps.get(position);
ImageView appIcon = (ImageView) convertView
.findViewById(R.id.item_app_icon);
appIcon.setImageDrawable(k.icon);
TextView appLabel = (TextView) convertView
.findViewById(R.id.item_app_label);
appLabel.setText(k.label);
TextView appName = (TextView) convertView
.findViewById(R.id.item_app_name);
appName.setText(k.name);
final String ss;
ss = k.name;
ch = (CheckBox) convertView.findViewById(R.id.c1);
ch .setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean b) {
}
});
ch.setChecked(apps.get(position).c1);
return convertView;
}
};