how to set listviewadapter in android custom dialog?
- by UMMA
hi,
i am using following code to setlistview adapter but giving me error at last line
public class MyCustomDialog extends Dialog
{
String[] items= {"lorem", "ipsum", "dolor", "sit", "amet",
"consectetuer", "adipiscing", "elit", "morbi", "vel",
"ligula", "vitae", "arcu", "aliquet", "mollis",
"etiam", "vel", "erat", "placerat", "ante",
"porttitor", "sodales", "pellentesque", "augue", "purus"};
TextView selection;
public MyCustomDialog(Context context)
{
super(context);
}
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.mylistviewdialog);
ListView lst=(ListView)findViewById(R.id.mylist);
lst.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, items));
// error here The constructor ArrayAdapter<String>(MyCustomDialog, int, String[]) is undefined
}
}
please guide what mistake am i doing?
any help would be appreciated.