How do I avoid hiding (or dismissing) an AlertDialog when clicking a NeutralButton?

You might be better off creating a custom dialog. You can use any activity, and just set the theme for the activity to Theme.Dialog. I.

E, in your manifest.

Thanks Mayra, I'll dig this approach. – Yoo Matsuo Jun 22 '10 at 17:15.

If you add a button using any of those setButton methods the dialog will dismiss after the handler runs. So you have two options. Create your own dialog and have the button work however you want.

Or two, Since you are using a list you may be able to call getListView on the AlertDialog and call addFooterView with a Button. That solution may look weird though with the other buttons.

Thanks Rpond. You assured me that there is no normal way to avoid that behavior. I'll take a look at creating a custom dialog approach.

– Yoo Matsuo Jun 22 '10 at 17:16.

I achieved selecting/deselecting all the items by the following approach. The idea comes from Rpond's advice, thanks Rpond! -- /res/layout/dialog_footer.

Xml -- Code here protected Dialog onCreateDialog( int index) { AlertDialog builder= new AlertDialog. Builder(this) . SetTitle( "title" ) .

SetMultiChoiceItems(items, selections, new DialogInterface. OnMultiChoiceClickListener(){ @Override public void onClick( DialogInterface dialog, int clicked, boolean selected ) { } }) .create(); LayoutInflater inflater = (LayoutInflater) this. GetSystemService(LAYOUT_INFLATER_SERVICE); View layout = inflater.

Inflate(R.layout. Dialog_footer, (ViewGroup)findViewById(R.id. FooterRoot)); Button selectAllButton = (Button)layout.

FindViewById(R.id. SelectAllButton); selectAllButton. SetOnClickListener(new OnClickListener(){ @Override public void onClick(View arg0) { Log.

V("Test", "hello"); } }); builder. SetView(layout); return builder; } It works exactly what I want to. Yokyo.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions