Code example for CursorAdapter

Methods: getActivity

0
		this.listener=listener;
	} 
 
	class RestaurantAdapter extends CursorAdapter {
		RestaurantAdapter(Cursor c) {
			super(getActivity(), c);
		} 
		@Override 
		public void bindView(View row, Context ctxt,
				Cursor c) {
			RestaurantHolder holder=(RestaurantHolder)row.getTag();
			holder.populateFrom(c, helper);
		} 
		@Override 
		public View newView(Context ctxt, Cursor c,
				ViewGroup parent) {
			LayoutInflater inflater=getActivity().getLayoutInflater();
			View row=inflater.inflate(R.layout.row, parent, false);
			RestaurantHolder holder=new RestaurantHolder(row);
			row.setTag(holder);
			return(row);