Hi:
I'm now create a listview in a dialog. But I don't know how to
detected if an item is clicked. Then background activity is
"PreferenceActivity", and the "onListItemClick" method seems not work.
Here is the relevant code:
----------------------------------------------------------------------------------------------------------
public void changeConnPref() {
conns = new ArrayList<String>();
conns.add("WIFI");
conns.add("Bluetooth");
mDialog = new Dialog(this);
mDialog.setContentView(R.layout.connpreference);
mDialog.setTitle("Connection Preference");
bConnAdapter = new ConnAdapter(conns, mDialog.getContext());
ListView dlv = (ListView) mDialog.findViewById(R.id.conn_list);
dlv.setAdapter(bConnAdapter);
Button bOk = (Button) mDialog.findViewById(R.id.pre_OK);
bOk.setOnClickListener(new OnClickListener() {
public void onClick(final View v) {
mDialog.dismiss();
}
});
Button bCancel = (Button) mDialog.findViewById(R.id.pre_cancel);
bCancel.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mDialog.cancel();
}
});
}
--------------------------------------------------------------------------------------------------------------
Can anyone help?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---