嗨,我是第一次使用对话框。我想在单击 listView 中的项目后创建一个对话框:
String[] listItems = {"Colour", "Font Size",};
ListView lv = (ListView) findViewById(R.id.settings_list);
lv.setAdapter(new ArrayAdapter<String>
(this, android.R.layout.simple_list_item_1, listItems));
lv.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView<?> parent, View
view, int position, long id)
{
String[] listItems = {"Colour", "Font Size",};
if(listItems[position].equals("Font Size"))
{
public dialog onCreateDialog(Bundle savedInstanceState)
{
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle("Choose Font Size");
}
}
}
});
我在 onCreateDialog(Bundle savedInstanceState) Eclipse 想要一个 ; 围绕Bundle savedInstanceState,但developer.android另有说明。有小费吗?