2023-11-08 21:40:39 +01:00
|
|
|
package android.widget;
|
|
|
|
|
|
2024-08-25 11:20:01 +02:00
|
|
|
import android.content.Context;
|
|
|
|
|
import android.database.Cursor;
|
|
|
|
|
|
2023-11-08 21:40:39 +01:00
|
|
|
public abstract class CursorAdapter extends BaseAdapter {
|
2024-08-25 11:20:01 +02:00
|
|
|
|
|
|
|
|
private Cursor cursor;
|
|
|
|
|
|
|
|
|
|
public CursorAdapter(Context context, Cursor cursor, boolean autoRequery) {
|
|
|
|
|
this.cursor = cursor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CursorAdapter(Context context, Cursor cursor, int flags) {
|
|
|
|
|
this.cursor = cursor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void changeCursor(Cursor cursor) {
|
|
|
|
|
this.cursor = cursor;
|
2024-09-03 17:49:56 +02:00
|
|
|
notifyDataSetChanged();
|
2024-08-25 11:20:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Cursor getCursor() {
|
|
|
|
|
return cursor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int getCount() {
|
|
|
|
|
return cursor == null ? 0 : cursor.getCount();
|
|
|
|
|
}
|
2023-11-08 21:40:39 +01:00
|
|
|
}
|