Code example for CursorAdapter

Methods: getActivity

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