If I´m not wrong I can´t inflate a layout on an alertdialog, right? On this Layout I have more than a ListView (buttons and TextViews) so to use an AlertDialog probably is not the best solution for me right now.
Mark, thanks for your answers. About the context, I didn´t get it. I thought that when I created a dialog I should pass to it the context of the activity that created it, am I wrong? If I don´t decide to use an alertdialog, is there a way to make it work using a "pure" dialog? Thank you guys very much! On 7 set, 17:35, Mark Murphy <[email protected]> wrote: > 2010/9/7 Gabriel Simões <[email protected]>: > > > > > > > Here is my code: > > > Dialog dialog = new Dialog(this); > > dialog.setContentView(R.layout.save); > > dialog.setTitle("Program Saving Center"); > > final ListView lvList = (ListView) > > dialog.findViewById(R.id.lvList); > > > lvList.setOnItemClickListener(new OnItemClickListener(){ > > �...@override > > public void onItemClick(AdapterView<?> arg0, View > > arg1, int arg2, > > long arg3){ > > removeDialog(DIALOG_SAVE_ID); > > } > > }); > > > lvList.setAdapter(new DBAdapter(this.getApplicationContext())); > > > I´m stuck on this... > > Either: > > -- Use AlertDialog.Builder and setAdapter(), supplying the listener that way, > or > > -- Create a dialog-themed ListActivity > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > Android Training in London:http://skillsmatter.com/go/os-mobile-server -- 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

