[android-developers] Re: Dialog and Other View
Jithin,
In Android, if the dialog is shown, the area beneath it cant get any
user interaction.
And this is quite a useful property that when you have to show a
progress in any process
and you want to restrict user not to do any UI interaction,
then instead of changing the visibility of the controls or making them
disable,
just show an overlay or dialog.
If you want to show the list in the dialog, you can refer the dialog
activity in the API demos which describes all types of dialogs.
or refer following:
final Runnable showSitesListingDialog = new Runnable() {
public void run() {
LayoutInflater inflator = BaseScreen.this.getLayoutInflater();
View view = inflator.inflate(R.layout.sites_list, null);
ListView sitesListView = (ListView) view
.findViewById(R.id.ListView01);
sitesListView.setAdapter(new ArrayAdapter<String>(BaseScreen.this,
android.R.layout.simple_list_item_single_choice,
sitesNameArray));
sitesListView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
sitesListView.setItemChecked(
applicationData.getCurrrentSiteIndex(), true);
AlertDialog.Builder sitesDialog = new AlertDialog.Builder(
BaseScreen.this);
sitesDialog.setTitle(R.string.sites_list_dialog_title);
sitesDialog.setView(view);
sitesDialog.setPositiveButton(BaseScreen.this.getResources()
.getString(R.string.ok),
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int whichButton) {
// add
implementation
}
}
});
sitesDialog.show();
}
};
On Nov 28, 11:16 pm, Jithin <danijanuv...@gmail.com> wrote:
> Hi All,
>
> I need to create a dialog which contains a ListView. That shoulb
> be displayed when a button is clicked. My requirement is that When the
> dialog opens both the dialog and the button should have user
> interaction. ie Listview in the Dialog and button in the main Activity
> should be clickable.Is that possible.Pls help me....
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home