by Niketa » Mon Nov 10, 2008 9:24 am
hi,
after creating a master list, try following,
if (item.getTitle().equals("Item1")) {
final ListAdapter l = new ArrayAdapter<String>(this,
android.R.layout.select_dialog_singlechoice, childlist);
new AlertDialog.Builder(context).setTitle("Detail List").setIcon(R.drawable.alert)
.setPositiveButton("OK", new OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
//yr code to do after clicking sub item.
}
}).setNegativeButton("Cancel", new OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
}
}).setSingleChoiceItems(l, 0, new OnClickListener() {
public void onClick(DialogInterface arg0, int arg1) {
listInt = arg1;
}
}).show();
}
Hope it helps you.
and this is like sudo code you can put yr logic whatever you want to do.