i want to remove specific user with its uniquid i have parse json_encode($data); from volley response:
this is my response:
[
{
"uniqid":"h5faweWtd",
"name":"Test_1",
"address":"tst",
"email":"ru_tst@tst.cc",
"mobile":"12345",
"city":"indd"
},{
"uniqid":"h5Wtd",
"name":"Test_2",
"address":"tst",
"email":"ru_tst@tst.cc",
"mobile":"1235945",
"city":"indd4"
},{
"uniqid":"h5Wtd25",
"name":"Test_3",
"address":"tdsdsst",
"email":"rsfu_tst@tsfst.cc",
"mobile":"1263345",
"city":"indd9"
}
]
I want to remove specific user with its uniquid
I'll easily do it in php with the help of this code:
foreach ($UserList as $key => $value) {
if (in_array('uniqid', $uniqid_To_Remove)) {
unset($UserList[$key]);
}
}
$UserList = json_encode($UserList);
echo $UserList;
but i want to get response and save it to shared preferences when internet is available and when internet is not available: then i want to get response data from shared preferences and remove specific user from its uniqid. how to do it in android java?
I am trying to delete an entire user. the problem is that the object position is not static, it can be anywhere in the array. the only thing that is static that i have is uniqid.