|
@@ -110,7 +110,7 @@ public class DatabaseHelper {
|
|
|
} else {
|
|
|
ArrayList<ApnModel> arrayList = new ArrayList<>();
|
|
|
ContentResolver resolver = context.getContentResolver();
|
|
|
- Uri uri = Uri.parse(DB_GOPLAY_APN + "/" + 0);
|
|
|
+ Uri uri = Uri.parse(DB_GOPLAY_APN);
|
|
|
Cursor cursor = resolver.query(uri, null, null, null, null);
|
|
|
if (cursor == null) {
|
|
|
Log.d(TAG, "getApnList: cursor == null");
|
|
@@ -124,6 +124,7 @@ public class DatabaseHelper {
|
|
|
Log.d(TAG, "getApnList: db ok");
|
|
|
do {
|
|
|
ApnModel bean = new ApnModel();
|
|
|
+ bean._id = cursor.getString(cursor.getColumnIndex("_id"));
|
|
|
bean.apn_id = cursor.getString(cursor.getColumnIndex("apn_id"));
|
|
|
bean.name = cursor.getString(cursor.getColumnIndex("name"));
|
|
|
bean.apn_name = cursor.getString(cursor.getColumnIndex("apn_name"));
|
|
@@ -191,7 +192,7 @@ public class DatabaseHelper {
|
|
|
|
|
|
} else {
|
|
|
new Thread(()->{
|
|
|
- Uri uri = Uri.parse(DB_GOPLAY_APN + "/" + model.apn_id);
|
|
|
+ Uri uri = Uri.parse(DB_GOPLAY_APN + "/" + model._id);
|
|
|
ContentValues values = new ContentValues();
|
|
|
values.put("apn_id", model.apn_id);
|
|
|
values.put("name", model.name);
|
|
@@ -219,12 +220,12 @@ public class DatabaseHelper {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static void deleteAPN(Context context, String apnId) {
|
|
|
+ public static void deleteAPN(Context context, String _id) {
|
|
|
if (Macros.DEBUG) {
|
|
|
|
|
|
} else {
|
|
|
new Thread(()->{
|
|
|
- Uri uri = Uri.parse(DB_GOPLAY_APN + "/" + apnId);
|
|
|
+ Uri uri = Uri.parse(DB_GOPLAY_APN + "/" + _id);
|
|
|
int row = context.getContentResolver().delete(uri, null, null);
|
|
|
Log.d(TAG, "updateAPN: " + row);
|
|
|
}).start();
|