Code example for CursorAdapter

Methods: getActivity

0
     
    /*********************************************/ 
     
    class AssignmentAdapter extends CursorAdapter {
    	AssignmentAdapter(Cursor c) {
    		super(getActivity(), c);
    	} 
    	 
    	@Override 
    	public void bindView(View row, Context ctxt, Cursor c) {
    		AssignmentHolder holder = (AssignmentHolder)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);
    		AssignmentHolder holder = new AssignmentHolder(row);
    		row.setTag(holder);