I’m trying to show an AlertDialog that has a List. When I run the aplication on Android IC I haven’t any problem, but when I try it on Android 2.3 the AlertDialog appears with an horrible border that it’s on the superior and on the inferior part of the View.
I’ve tried with themes and with many things, but I’ve the problem added that AlertDialog.Builder(Context, Theme) is not valid on APIs below 11.
Do you know any solution? Thanks!
public boolean updialog (String table) {
String [] data = bd.List(1, table);
if(data[0]=="") {
AlertDialog.Builder dialog = new AlertDialog.Builder(this,android.R.style.Theme_Translucent_NoTitleBar);
View view = View.inflate(getApplicationContext(), R.layout.drop_no_resquest, null);
dialog.setView(view); dialog.create();
dialog.show();
return true;
}
AlertDialog.Builder dialog = new AlertDialog.Builder(a);
View view = View.inflate(getApplicationContext(), R.layout.drop, null);
ListView lv = (ListView) view.findViewById(R.id.drop_listview);
ArrayAdapter<String> adap = new ArrayAdapter<String> (getApplicationContext(),
R.layout.list_item_custom,R.id.list_item_custom_text,data);
lv.setAdapter(adap);
dialog.setView(view);
dialog.create();
dialog.show(); return true;
}
you can use like this
where
ThemeDialogCustomwill look like thisFor android < 3.0
you need to use
Dialogclass.