我想为我的程序使用条件数组,但我在实现它时遇到了问题。
我有一个数组:
//I want to put my condition in array column 3 (in title)
Data[] hotel = {
new Data(-6.8851995, 108.4978142, "Grage Sangkan Hotel & Spa",
"Jl. Raya Sangkanhurip No.1 Desa Sangkanhurip"),
new Data(-6.879592, 108.513353, "Prima Hotel Sangkanhurip ",
"Jl. Panawuwan No.121 Kec. Cigandamekar "),
new Data(-6.883889, 108.500000, "Tirta Sanita Spa Resort ",
"Jl.Panawuwan No.98 Kec.Cigandamekar")
}
我有一个条件:
//my condition equals array column 3 (in title)
if (v.getTitle().equals(hotel[3] ? ??)){ // in here I don't know what can I do
tempat = new Intent(Peta.this, KetWisata.class);
// TODO Auto-generated method stub
if (v.getTitle().contains("Wisata Cibulan")) {
tampil = "wis_cibulan";
}
if (v.getTitle().contains("Linggarjati Indah")) {
tampil = "wis_linggarjati";
}
if (v.getTitle().contains("Balong Dalem")) {
tampil = "wis_balongdalem";
}
} else {
// ...
}