Code example for SimpleAdapter

Methods: notifyDataSetChanged

0
	private void showStop(Intent intent) {
		Bundle extras = intent.getExtras();
		HashMap<String, String> item = new HashMap<String, String>();
		item.put("title", extras.getString("stop.name"));
		_list.add(item);
		_adapter.notifyDataSetChanged();
	} 
	 
	private int minutesFromNow(int secondsSinceMidnight) {
		Date now = new Date();
		int elapsedSinceMidnight = now.getHours() * 3600 + now.getMinutes() * 60 + now.getSeconds();
		return (secondsSinceMidnight - elapsedSinceMidnight) / 60;
	} 
	 
	private void showTrip(Intent intent) {
		Bundle extras = intent.getExtras();
		HashMap<String, String> item = new HashMap<String, String>();
		item.put("title", String.format("%d %s (%d minutes)",
				extras.getInt("trip.route"),
				extras.getString("trip.headsign"),
				minutesFromNow(extras.getInt("arrival"))));