当我按下项目“呼叫商店”时,我想在我的应用程序中拨打电话,
这是我的代码:
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
// TODO Auto-generated method stub
final Entity_BikeShopRepair toko = adapterShop.getItem(position);
CharSequence[] items = { "View on Map", "Call Shop" };
AlertDialog.Builder builder = new AlertDialog.Builder(
Tab_Shop_Repair_ListView_Activity.this);
builder.setTitle(toko.getShop_Name());
builder.setItems(items, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int item) {
switch (item) {
case 0:
Toast.makeText(Tab_Shop_Repair_ListView_Activity.this,
toko.getShop_Name(), Toast.LENGTH_LONG).show();
break;
case 1:
arrayList(Tab_Shop_Repair_ListView_Activity.this,
toko.getPhone_Number());
Intent intent = new Intent(Intent.ACTION_CALL, Uri
.parse(arrayList.toString()));
startActivity(intent);
break;
case 2:
break;
}
}
});
AlertDialog alert = builder.create();
alert.show();
}
但代码是错误的“方法arrayList(Tab_Shop_Repair_ListView_Activity,String)未定义类型new DialogInterface.OnClickListener(){}”
我不知道如何解决它,有人可以帮助我吗?太感谢了。