private void populateMyMovies(ListView tLV) throws ParseException { List<Movie> movies = db.getAllMovies(sortStr, sortDir); List<Map<String, String>> list = new ArrayList<Map<String, String>>(); if (movies.size() < 1) { toastMessage(MainActivity.this, getString(R.string.no_movie_notice)); } else { for (Movie i : movies) { Map map = new HashMap(); map.put("id", i.getId()); map.put("title", i.getTitle()); String target = i.getDateStr(); DateFormat df = new SimpleDateFormat("EEE MMM dd kk:mm:ss z yyyy", Locale.ENGLISH); DateFormat newf = new SimpleDateFormat("EEE, MMM d, yyyy", Locale.ENGLISH); Date mDate = df.parse(target); String newDate = newf.format(mDate); map.put("date", newDate); map.put("rating", i.getRating()); map.put("lat", String.valueOf(i.getVenue().getLat())); map.put("lng", String.valueOf(i.getVenue().getLng())); map.put("type", i.getVenue().getVenue_type()); map.put("venue_name", i.getVenue().getVenue_name()); list.add(map); } movieAdapter = new SimpleAdapter( this, list, R.layout.my_movies_layout, new String[] {"title", "date", "rating", "type"}, new int[] { R.id.my_movie_title, R.id.my_movie_date, R.id.my_movie_rating, R.id.my_movie_icon }); movieAdapter.setViewBinder(new MyMovieBinder()); tLV.setAdapter(movieAdapter); tLV.setLongClickable(true); tLV.setOnItemClickListener( new AdapterView.OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Map item = (Map) parent.getAdapter().getItem(position); LatLng latlong = new LatLng( Double.valueOf(item.get("lat").toString()), Double.valueOf(item.get("lng").toString())); mMap.clear(); Marker marker = mMap.addMarker( new MarkerOptions() .position(latlong) .title(item.get("title").toString()) .snippet(item.get("venue_name").toString())); // Zoom in, animating the camera. mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latlong, 13), 800, null); marker.showInfoWindow(); } }); } }