打開對話框中,我發現一個問題,同時對listView..the代碼點擊打開的對話框中,我有回報如下,請檢查是否有任何的錯誤..如何從列表視圖
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.my_info);
ListView lv2;
String lv_arr1[]={"Language:NotSpecified"};
lv2=(ListView)findViewById(R.id.listViewInfo1);
lv2.setAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1 , lv_arr1));
ListView lvInfo1;
ListViewInfo adapter;
String lvTitle[]={"online"};
String lvDesc[]={"Change Status"};
adapter = new ListViewInfo(this, lvTitle,lvDesc);
lvInfo1=(ListView)findViewById(R.id.listViewInfo2);
lvInfo1.setAdapter(adapter);
lvInfo1.setOnItemClickListener(this);
}
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long id)
{
final CharSequence[] items = {"Online", "Away", "Do not distrub","Invisible","Offline"};
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Change Status");
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
}
});
}
的末尾添加以下代碼,什麼是PR oblem?代碼看起來不錯。 –
onclick沒有對話框出現..so可以plese找到問題在哪裏 – AndroidDev