Code example for View

Methods: findViewById

0
		LayoutInflater inflater = (LayoutInflater) context
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		View v = inflater.inflate(R.layout.balloon_overlay_example2, parent);
		 
		// setup our fields 
		title = (TextView) v.findViewById(R.id.balloon_item_title);
		snippet = (TextView) v.findViewById(R.id.balloon_item_snippet);
		image = (ImageView) v.findViewById(R.id.balloon_item_image);
 
	} 
 
	@Override 
	protected void setBalloonData(CustomOverlayItem item, ViewGroup parent) {
		 
		// map our custom item data to fields 
		title.setText(item.getTitle());
		snippet.setText(item.getSnippet());
		 
		// get remote image from network. 
		// bitmap results would normally be cached, but this is good enough for demo purpose. 
		image.setImageResource(R.drawable.icon);