アクティビティのリストビューをクリックしたときにアラート ダイアログを表示したいのですが、アラート ダイアログを表示するコードはありますが、コードに何か問題があることがわかっており、それを修正する方法がわかりません。アラートは希望どおりに表示されませんでした。 . ここに私のコードがあります:
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
new bike_type_dao(responsetype).view_bike_type();
final Entity_Brand brand = adapterBrand.getItem(position);
builder = new Dialog(this);
builder.setTitle(brand.getBrand_name());
LayoutInflater li = (LayoutInflater) this
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View view = li.inflate(R.layout.tab_brand_activity, null, false);
builder.setContentView(view);
builder.setCancelable(true);
listtype = (ListView) builder.findViewById(R.id.list_sepeda);
listtype.setOnItemClickListener((OnItemClickListener) this);
listtype.setAdapter(new ArrayAdapter<Entity_Bike_Type>(this,
android.R.layout.simple_list_item_1, arrayList));
listtype.showContextMenu();
builder.show();
}
誰かがこの問題で私を助けてくれることを願っています。ありがとうございました。