-
Notifications
You must be signed in to change notification settings - Fork 5.3k
/
Copy pathDataContract.java
32 lines (22 loc) · 1018 Bytes
/
DataContract.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package course.examples.contentproviders.stringcontentprovider;
import android.content.ContentResolver;
import android.net.Uri;
// Contract Class for accessing ContentResolver
public final class DataContract {
public static final String _ID = "_id";
public static final String DATA = "data";
public static final String DATA_TABLE = "data_table";
private static final Uri BASE_URI = Uri
.parse("content://course.examples.ContentProviders.StringContentProvider/");
// The URI for this table.
public static final Uri CONTENT_URI = Uri.withAppendedPath(BASE_URI,
DATA_TABLE);
// Mime type for a directory of data items
public static final String CONTENT_DIR_TYPE = ContentResolver.CURSOR_DIR_BASE_TYPE
+ "/StringContentProvider.data.text";
// Mime type for a single data item
public static final String CONTENT_ITEM_TYPE = ContentResolver.CURSOR_ITEM_BASE_TYPE
+ "/StringContentProvider.data.text";
// All columns of this table
public static final String[] ALL_COLUMNS = { _ID, DATA };
}