Set TextView based on Volley Response in Android - android

I am using Volley in application.I am getting name,email,phone values from Volley response.The condition is if name and email value is null, I want to set phone value in TextView.If name and phone value is empty, I want to set email in TextView. if phone and email is empty,I want to set name in TeextView.
This is JSON response
{
"id": 25,
"email": "aa#gmail.com",
"phone": null,
"full_name": ""
}
This is how I have parsed JSON
JsonObjectRequest foodie_request = new JsonObjectRequest(Request.Method.GET,url, null, new Response.Listener<JSONObject>() {
#Override
public void onResponse(JSONObject response)
{
try {
String fullName = response.getString("full_name");
String phone=response.getString("phone");
String email=response.getString("email");
if(email.trim().equals("") && fullName.trim().equals(""))
{
entry.setName(phone);
}
else if(phone==null && fullName.trim().equals(""))
{
entry.setName(email);
}
else if(email.trim().equals("") && phone==null ) {
entry.setName(fullName);
}
// progressDialog.dismiss();
adapter.notifyDataSetChanged();
} catch (JSONException e) {
e.printStackTrace();
}
}
How to do this ?

Check this code:
if(fullName.isEmpty() && fullName != null && email.isEmpty() && email != null)
textView.setText(phone);
if(fullName.isEmpty() && fullName != null && phone.isEmpty() && phone != null)
textView.setText(email);
if(email.isEmpty() && email != null && phone.isEmpty() && phone != null)
textView.setText(fullName);

First of all do not get value null from database according to your question otherwise you will get NullPointerException get a blank string and try this one.
JsonObjectRequest foodie_request = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
#Override
public void onResponse(JSONObject response) {
try {
String fullName = response.getString("full_name");
String phone = response.getString("phone");
String email = response.getString("email");
if (fullName.toString().trim().length() == 0 && email.toString().trim().length() == 0) {
entry.setName(phone);
} else if (fullName.toString().trim().length() == 0 && phone.toString().trim().length() == 0) {
entry.setName(email);
} else if (phone.toString().trim().length() == 0 && email.toString().trim().length() == 0) {
entry.setName(fullName);
}
// progressDialog.dismiss();
adapter.notifyDataSetChanged();
} catch (JSONException e) {
e.printStackTrace();
}
}
}
Try using this, hope it helps.

if(TextUtils.isEmpty(email) && TextUtils.isEmpty(fullName)) {
entry.setText(phone);
}
else if(TextUtils.isEmpty(phone) && TextUtils.isEmpty(fullName))
{
entry.setText(email);
}
else if(TextUtils.isEmpty(email) && TextUtils.isEmpty(phone)) {
entry.setText(fullName);
}
Try with this, TextUtils.isEmpty(str) also check the null value so no need to further loop.

Related

App Showing No Internet Connection in PIE version only

My App is working perfectly fine in all android version except Pie version.
In Pie it shows No internet Connection whereas i check it with Wifi and Mobile data..it is no internet problem. This Issue is related to Pie Version.
i Try following solutions:
android:usesCleartextTraffic="true"
android:networkSecurityConfig="#xml/network_security_config"
But both didnt work.
This is my Login button code, in which it comes in OnFailure
private void onLoginUser(String email, String password) {
Call<LoginModel> call = ApiClient.getClientInstance().getClientService().userlogin(email, password);
call.enqueue(new Callback<LoginModel>() {
#Override
public void onResponse(Call<LoginModel> call, Response<LoginModel> response) {
mProgressBar.setVisibility(View.GONE);
LoginModel jsonLoginResult = response.body();
if (response.code()== 200) {
Log.e("Response", response.code() + "");
}
if (response.code() == 400 ) {
Utility.getInstance(LoginActivity.this).showSnackBarLong(response.message(), mLoginActivity);
return;
}
if (response.code() == 404 ) {
Utility.getInstance(LoginActivity.this).showSnackBarLong(response.message(), mLoginActivity);
return;
}
if (response.code() == 500 ) {
Utility.getInstance(LoginActivity.this).showSnackBarLong(response.message(), mLoginActivity);
return;
}
if (jsonLoginResult == null ) {
Utility.getInstance(LoginActivity.this).showSnackBarLong("Data not found", mLoginActivity);
return;
}
if (jsonLoginResult != null && response != null && response.isSuccessful() && response.body() != null) {
String jError = "" ;
String jMessage = "" ;
String jUserStatus = "" ;
try {
jError = String.valueOf(jsonLoginResult.getError());
jMessage = String.valueOf(jsonLoginResult.getMessage());
jUserStatus = String.valueOf(jsonLoginResult.getStatus());
}catch (NullPointerException e){
Log.d("Result", e+"");
}
TelephonyManager mTelephonyManager = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
#SuppressLint("MissingPermission")
String phone_imei= mTelephonyManager.getDeviceId();
myPreference.saveString(Constants.IMEI_NUMBER , phone_imei);
if(jUserStatus.equals(0) || jUserStatus.equalsIgnoreCase("0")){
myPreference.saveString(Constants.USER_STATUS , "Disapproved");
}
if(jUserStatus.equals(1)|| jUserStatus.equalsIgnoreCase("1")){
myPreference.saveString(Constants.USER_STATUS , "Approved");
}
if(jUserStatus.equals(3)|| jUserStatus.equalsIgnoreCase("3")){
myPreference.saveString(Constants.USER_STATUS , "Under Process");
}
if(jError.equalsIgnoreCase("false")){
String jUserId = String.valueOf(jsonLoginResult.getId());
String jUserApikey = String.valueOf(jsonLoginResult.getApikey());
String jUserName = String.valueOf(jsonLoginResult.getName());
String jUserEmail = String.valueOf(jsonLoginResult.getEmail().trim());
String jUserPhone = String.valueOf(jsonLoginResult.getPhone_no().trim());
String jUserRegisterDate = String.valueOf(jsonLoginResult.getCreated_at());
String jUserLogin_date = String.valueOf(jsonLoginResult.getLogin_date());
String jUserPancardImage = String.valueOf(jsonLoginResult.getPan_card_image());
String jUserChequeImage = String.valueOf(jsonLoginResult.getCheque_number_image());
String jUserAddressImage = String.valueOf(jsonLoginResult.getAddressProofImage());
String jAddress = String.valueOf(jsonLoginResult.getAddress());
String jCompanyName = String.valueOf(jsonLoginResult.getCompanyName());
String jCountryId = String.valueOf(jsonLoginResult.getCountryId());
String jStateId = String.valueOf(jsonLoginResult.getStateId());
String jCityId = String.valueOf(jsonLoginResult.getCityId());
String jStateName = String.valueOf(jsonLoginResult.getStateName());
String jCityName = String.valueOf(jsonLoginResult.getCityName());
String jRelationShipManager = String.valueOf(jsonLoginResult.getRelationshipManagerId());
Utility.getInstance(LoginActivity.this).showSnackBarLong(jMessage, mLoginActivity);
new Handler().postDelayed(new Runnable() {
#Override
public void run() {
try {
mUNameLogin.setText("");
mPasswordLogin.setText("");
Intent i = new Intent(LoginActivity.this, HomeActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(i);
LoginActivity.this.finish();
} catch (Exception e) {
e.printStackTrace();
}
}
}, 2000);
}
if(jError.equalsIgnoreCase("null")){
Utility.getInstance(LoginActivity.this).showSnackBarLong(jMessage, mLoginActivity);
return;
}
if(jError.equalsIgnoreCase("true")){
popupMessageDialog(jMessage);
//return;
}
}
else {
assert response != null;
Utility.getInstance(LoginActivity.this).showSnackBarLong(" "+response.message(), mLoginActivity);
return;
}
}
#Override
public void onFailure(Call<LoginModel> call, Throwable t) {
mProgressBar.setVisibility(View.GONE);
if (LoginActivity.this != null) {
Utility.getInstance(LoginActivity.this).showSnackBarLong("No Internet Connection", mLoginActivity);
return;
}
}
});
Try bellow tow thing one remove networkSecurityConfig from your application tag and add bellow Code inside of your application tag and try
<application
android:name=".MyApplication"
android:allowBackup="true"
android:enabled="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:largeHeap="true"
android:theme="#style/generalnotitle"
android:usesCleartextTraffic="true">
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />

get all playlist of an user from YouTube

I am working on an android application where user will login in app using their gmail account. I need to show list of youtube playlist of that user. I have used following code -
private String getAllPlayList() {
YouTube youtube = new YouTube.Builder(new NetHttpTransport(), new JacksonFactory(), new HttpRequestInitializer() {
public void initialize(HttpRequest request) throws IOException {
}
}).setApplicationName("My Project").build();
try {
HashMap<String, String> parameters = new HashMap<>();
parameters.put("part", "snippet,contentDetails");
parameters.put("mine", "true");
parameters.put("maxResults", "25");
parameters.put("onBehalfOfContentOwner", "");
parameters.put("onBehalfOfContentOwnerChannel", "");
parameters.put("key","AIzaSyASISGgWoBqDijVmzUpYCbgaWJ_ULJWdiQ");
YouTube.Playlists.List playlistsListMineRequest = youtube.playlists().list(parameters.get("part").toString());
if (parameters.containsKey("mine") && parameters.get("mine") != "") {
boolean mine = (parameters.get("mine") == "true") ? true : false;
playlistsListMineRequest.setMine(true);
}
if (parameters.containsKey("maxResults")) {
playlistsListMineRequest.setMaxResults(Long.parseLong(parameters.get("maxResults").toString()));
}
if (parameters.containsKey("onBehalfOfContentOwner") && parameters.get("onBehalfOfContentOwner") != "") {
playlistsListMineRequest.setOnBehalfOfContentOwner(parameters.get("onBehalfOfContentOwner").toString());
}
if (parameters.containsKey("onBehalfOfContentOwnerChannel") && parameters.get("onBehalfOfContentOwnerChannel") != "") {
playlistsListMineRequest.setOnBehalfOfContentOwnerChannel(parameters.get("onBehalfOfContentOwnerChannel").toString());
}
if (parameters.containsKey("key") && parameters.get("key") != "") {
playlistsListMineRequest.setKey(parameters.get("key").toString());
}
PlaylistListResponse response = playlistsListMineRequest.execute();
Log.d("PlayList",response.toString());
return response.toPrettyString();
}
catch (Exception e)
{
e.printStackTrace();
return e.getMessage().toString();
}
}
But I am getting following response -
"message" : "The request uses the mine parameter but is not properly authorized.",
Please help.

Arraylist gets cleared on its own in android

I have an asynctask which gets data from the local Sqlite database and shows it to the user. If the data isnt there in the sqlite, a network call will be made to the server to retrieve server side data.
The issue is that when i call the db and i get the data, i add it to the list. I check the size of the list and it shows content.
Then when i try to notify the adapter of the arraylist, it shows list size 0 without any clear() call being made
The files are as follows:
package com.example.project.recommendedapp.AsyncTasks;
//SuggestionsGetterAsync start----------------------------------------------------------------------------------------------------------------
public class SuggestionsGetterAsync extends AsyncTask<String,Void,Void> {
private String queryString;
private WeakReference<Activity> weakReference;
private Activity localReference;
private Fragment localFragment;
private ArrayList<Suggestions> localSuggestionsList;
double latitude,longitude;
String cityName;
int request_counter_in_fragment;
public SuggestionsGetterAsync(Activity passedReference, Fragment passedFragment, ArrayList<Suggestions> localSuggestionsList,int request_counter_in_fragment,double ...coordinates){
weakReference=new WeakReference<Activity>(passedReference);
localReference=weakReference.get();
localFragment=passedFragment;
this.localSuggestionsList=localSuggestionsList;
latitude=coordinates[0];
longitude=coordinates[1];
this.request_counter_in_fragment=request_counter_in_fragment;
}
#Override
protected Void doInBackground(String... params) {
queryString=params[0];
cityName=params[1];
if(localReference!=null && !localReference.isDestroyed() && !localReference.isFinishing()) {
localReference.runOnUiThread(new Runnable() {
#Override
public void run() {
localSuggestionsList.clear();
((LocalFragmentInteractionInterface)localFragment).notifyAdapter();
}
});
//cancel the call to avoid load if it is a previously dispatched useless servelet
if(((GetRequestCounterFromFragment)localFragment).getRequestDispatchedCounter()!=request_counter_in_fragment){
this.cancel(true);
return null;
}
}
if(localReference!=null && !localReference.isDestroyed() && !localReference.isFinishing() && !queryString.equals("")){
//cancel the call to avoid load if it is a previously dispatched useless servelet
if(((GetRequestCounterFromFragment)localFragment).getRequestDispatchedCounter()!=request_counter_in_fragment){
this.cancel(true);
return null;
}
LocalDatabaseHelper localDatabaseHelper = LocalDatabaseHelper.getInstance(localReference);
localSuggestionsList=localDatabaseHelper.getLocalSearchSuggestions(queryString);
Log.d("FragmentCreate","localSuggestionsList size after db call is "+localSuggestionsList.size()); // prints ok and shows that the list has values
}
Log.d("FragmentCreate","localSuggestionsList size now is"+localSuggestionsList.size()); // prints ok and shows that the list has values
if (localSuggestionsList.size()==0) {
//basically first query the local cache, if nothing is found locally, go fetch the data from the server
//put the fetched results inside the local database
try {
//String serveleturl = "http://192.168.1.7:8080/Servelet/SearchSuggestionsServelet?latitude="+latitude+"&longitude="+longitude+"&cityName="+cityName+"&queryString="+URLEncoder.encode(queryString,"UTF-8");
String serveleturl = "http://kushan.dynu.com:8080/Servelet/SearchSuggestionsServelet?cityName="+URLEncoder.encode(cityName,"UTF-8")+"&queryString="+(queryString.equals("")?null:URLEncoder.encode(queryString,"UTF-8"));
OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(30000, TimeUnit.MILLISECONDS)
.readTimeout(30000,TimeUnit.MILLISECONDS)
.retryOnConnectionFailure(false)
.build();
Request request = new Request.Builder()
.url(serveleturl)
.build();
Response response = client.newCall(request).execute();
switch (response.code()){
case 444:
if((localReference!=null && !localReference.isDestroyed() && !localReference.isFinishing()) && (((GetRequestCounterFromFragment)localFragment).getRequestDispatchedCounter()==request_counter_in_fragment) && !isCancelled()) {
localReference.runOnUiThread(new Runnable() {
#Override
public void run() {
((LocalFragmentInteractionInterface)localFragment).setErrorText("No search results found",false);
}
});
}
break;
case 222:
if((localReference!=null && !localReference.isDestroyed() && !localReference.isFinishing()) && (((GetRequestCounterFromFragment)localFragment).getRequestDispatchedCounter()==request_counter_in_fragment) && !isCancelled()) {
localReference.runOnUiThread(new Runnable() {
#Override
public void run() {
((LocalFragmentInteractionInterface)localFragment).setErrorText("Hide the errortext",true);
}
});
}
JSONArray suggestionsArray = new JSONArray(response.body().string());
if(suggestionsArray.length()!=0){
try{
if(localReference!=null && !localReference.isDestroyed() && !localReference.isFinishing()){
LocalDatabaseHelper localDatabaseHelper = LocalDatabaseHelper.getInstance(localReference);
localDatabaseHelper.putSuggestions(suggestionsArray);
}
}catch (Exception e){
Log.e("FragmentCreate","Error saving the suggestion inside db",e);
}
}
for(int i=0;i<suggestionsArray.length();i++){
if(((GetRequestCounterFromFragment)localFragment).getRequestDispatchedCounter()==request_counter_in_fragment) {
localSuggestionsList.add(new Suggestions(suggestionsArray.getJSONObject(i)));
}else{
return null;
}
}
break;
default:
if((localReference!=null && !localReference.isDestroyed() && !localReference.isFinishing()) && (((GetRequestCounterFromFragment)localFragment).getRequestDispatchedCounter()==request_counter_in_fragment) && !isCancelled()) {
localReference.runOnUiThread(new Runnable() {
#Override
public void run() {
((LocalFragmentInteractionInterface)localFragment).setErrorText("No search results found",false);
}
});
}
break;
}
response.close();
}catch (Exception e){
if((localReference!=null && !localReference.isDestroyed() && !localReference.isFinishing()) && (((GetRequestCounterFromFragment)localFragment).getRequestDispatchedCounter()==request_counter_in_fragment) && !isCancelled()) {
localReference.runOnUiThread(new Runnable() {
#Override
public void run() {
((LocalFragmentInteractionInterface)localFragment).setErrorText("Check your Internet connection or try again after some time",false);
}
});
}
}
}else{
if (localReference!=null && !localReference.isDestroyed() && !localReference.isFinishing()) {
localReference.runOnUiThread(new Runnable() {
#Override
public void run() {
Log.d("FragmentCreate","before postExecute the size of the list is "+localSuggestionsList.size()); // prints size as zero for no reason
((LocalFragmentInteractionInterface)localFragment).setErrorText("Hide the errortext",true);
}
});
}
}
return null;
}
#Override
public void onPostExecute(Void voided){
if((localReference!=null && !localReference.isDestroyed() && !localReference.isFinishing()) && (((GetRequestCounterFromFragment)localFragment).getRequestDispatchedCounter()==request_counter_in_fragment)) {
Log.d("FragmentCreate","request counter in asynctask ="+request_counter_in_fragment+" queryString is = "+queryString+" "+localSuggestionsList.size()); // prints size as zero for no reason
((LocalFragmentInteractionInterface) localFragment).notifyAdapter();
if(queryString.equals("")){
((LocalFragmentInteractionInterface)localFragment).setErrorText("",true);
}
}
weakReference=null;
localReference=null;
localFragment=null;
queryString=null;
localSuggestionsList=null;
}
#Override
public void onCancelled(){
Log.d("FragmentCreate","AsyncTaskCancelled");
}
}
The function returning the List from sqlite is as follows:
public ArrayList<Suggestions> getLocalSearchSuggestions(String searchString) throws SQLiteException{
//localSuggestionsList.clear();
ArrayList<Suggestions> localSuggestionsList = new ArrayList<>();
SQLiteDatabase db = this.getReadableDatabase();
String sql = "SELECT "+TableAndColumnNames.SEARCH_RESULTS_DATA+" FROM "+TableAndColumnNames.SEARCH_RESULTS_TABLE_NAME+" WHERE "+TableAndColumnNames.SEARCH_RESULTS_SUGGESTION+" LIKE '%"+searchString+"%' limit 20";
Cursor c = db.rawQuery(sql,null);
JSONObject suggestionObject;
if(c!=null){
if(c.moveToFirst()){
do{
try{
//Log.d("FragmentCreate",c.getString(0)+" found in suggestion");
suggestionObject = new JSONObject(c.getString(0));
localSuggestionsList.add(new Suggestions(suggestionObject));
}catch (JSONException je){
Log.d("FragmentCreate","Data got corrupted for searched list");
}
}while(c.moveToNext());
}
c.close();
}
return localSuggestionsList;
}
if(localReference!=null && !localReference.isDestroyed() && !localReference.isFinishing()) {
localReference.runOnUiThread(new Runnable() {
#Override
public void run() {
localSuggestionsList.clear();
((LocalFragmentInteractionInterface)localFragment).notifyAdapter();
}
});
//cancel the call to avoid load if it is a previously dispatched useless servelet
if(((GetRequestCounterFromFragment)localFragment).getRequestDispatchedCounter()!=request_counter_in_fragment){
this.cancel(true);
return null;
}
}
Here you clear list and notify adapter
first check your db data update or not.

App crashes when click with empty text fields

I have write a method for register users for backendless. With filled all text fields I can register users. My problem is when when I click button with empty text fields app getting crash, but I wrote a if statement for check empty text fields and show a toast.
public void RegisterButtonPressed(View view) {
if(email.getText() == null || password.getText() == null || username.getText() == null){
Toast.makeText(this, "Every Fileds should be filled", Toast.LENGTH_SHORT).show();
} else {
if(email.getText() != null && password.getText() != null && username.getText() != null) {
final String emailS = email.getText().toString();
final String passwordS = password.getText().toString();
String usernameS = username.getText().toString();
BackendlessUser user = new BackendlessUser();
user.setEmail(emailS);
user.setPassword(passwordS);
user.setProperty("name",usernameS);
user.setProperty("Avatar","");
Backendless.UserService.register(user, new AsyncCallback<BackendlessUser>() {
#Override
public void handleResponse(BackendlessUser backendlessUser) {
Toast.makeText(RegisterActivity.this, "User Registration Successfull", Toast.LENGTH_SHORT).show();
Backendless.UserService.login(emailS, passwordS, new AsyncCallback<BackendlessUser>() {
#Override
public void handleResponse(BackendlessUser backendlessUser) {
Toast.makeText(RegisterActivity.this, "Logged", Toast.LENGTH_SHORT).show();
}
#Override
public void handleFault(BackendlessFault backendlessFault) {
Toast.makeText(RegisterActivity.this, "User Login Unsuccessfull: " + backendlessFault.getDetail(), Toast.LENGTH_SHORT).show();
}
});
}
#Override
public void handleFault(BackendlessFault backendlessFault) {
Toast.makeText(RegisterActivity.this, "User Registration Unsuccesful: " + backendlessFault.getDetail(), Toast.LENGTH_SHORT).show();
}
});
}
}
}
error log
you should check with
if(TextUtils.isEmpty(email.getText()))
instead of
if (email.getText() == null)
From my experience, the getText() was not return null if it empty, but empty string a.k.a ""
TextUtils.isEmpty() however, will check both null and "" as empty string
You're only checking if the string is null. If it's empty, your if statement will not catch that and could still cause a crash. You should be checking for empty string as well.
if(email.getText() == null || email.getText().length() == 0 ||
password.getText() == null || password.getText.length() == 0 ||
username.getText() == null || username.getText.length() == 0){
Toast.makeText(this, "Every Fileds should be filled", Toast.LENGTH_SHORT).show();
}
This happened with me on AppCompatAutoCompleteTextView, where I have added Spinner Adapter with Filterable.
I have overrided the AppCompatAutoCompleteTextView enoughToFilter() method.
#Override
public boolean enoughToFilter() {
return showAlways || super.enoughToFilter();
}
showAlways is a bool object where I was setting apply a filter with threshold.
As enoughToFilter () => Returns true if the amount of text in the field meets or exceeds the getThreshold() requirement.
On zero-length it was crashing when this showAlways is set to false, just make it to true or
set threshold to 0 & set showAlways to false.

Could not parse boolean values in parse

I am trying to parse a boolean value after using it with parseObject, but I cannot parse it?
Here is my code:
ParseQuery<ParseObject> query = ParseQuery.getQuery("SmsTable");
query.whereEqualTo("deviceId", android_id);
query.findInBackground(new FindCallback<ParseObject>() {
#Override
public void done(List<ParseObject> objects, com.parse.ParseException e) {
if (e == null) {
for (ParseObject smsObject : objects) {
if (smsObject!=null) {
Date time = (Date) smsObject.get("date");
myMsg = (String) smsObject.get("message");
usrNum = (String) smsObject.get("phoneNumber");
happend = (boolean) smsObject.get("happend");
result = time;
}
if (result != null) {
if (System.currentTimeMillis() >= result.getTime() && happend == false) {
// count++;
if (usrNum != null && myMsg != null) {
Log.d("message", myMsg);
Log.d("time", String.valueOf(result));
sendMsg2(myMsg, usrNum);
smsObject.put("happend", true);
}
}
}
}
}
}
});
You should call default methods of ParseObject to retrieve data instead of parsing :
ParseQuery<ParseObject> query = ParseQuery.getQuery("SmsTable");
query.whereEqualTo("deviceId", android_id);
query.findInBackground(new FindCallback<ParseObject>() {
#Override
public void done(List<ParseObject> objects, com.parse.ParseException e) {
if (e == null) {
for (ParseObject smsObject : objects) {
if (smsObject!=null) {
Date time = smsObject.getDate("date");
myMsg = smsObject.getString("message");
usrNum = smsObject.getString("phoneNumber");
happend = smsObject.getBoolean("happend");
result = time;
}
if (result != null) {
if (System.currentTimeMillis() >= result.getTime() && happend == false) {
// count++;
if (usrNum != null && myMsg != null) {
Log.d("message", myMsg);
Log.d("time", String.valueOf(result));
sendMsg2(myMsg, usrNum);
smsObject.put("happend", true);
}
}
}
}
}
}
});
You can simply use For loop for getting single object of Parse object and can use getBoolean() method for getting boolean value.
public void done(List<ParseObject> objects, com.parse.ParseException e) {
if (e == null) {
for (int i = 0; i < objects.size(); i++) {
happend = objects.get(i).getBoolean("happend");
}
}
}

Categories

Resources