在此Tutorial的帮助下
我做了onItemClickListner
课程
public class OnItemClickListenerListViewItem implements OnItemClickListener {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Context context = view.getContext();
TextView textViewItem = ((TextView) view.findViewById(R.id.textViewItem));
// get the clicked item name
String listItemText = textViewItem.getText().toString();
// get the clicked item ID
String listItemId = textViewItem.getTag().toString();
// Toast not showing Item name
Toast.makeText(context, "Item: " + listItemText + ", Item ID: " + listItemId, Toast.LENGTH_SHORT).show();
}
相机焦点无法正常工作
if (listItemText.equals("ROMYS")) {
CameraUpdate location = CameraUpdateFactory.newLatLngZoom(
coordinate, 15);
googleMap.animateCamera(location);
}
我试过这个Code,但它不起作用
这是我现在的班级代码myClassCode Pastbin Link