Add objects to an arraylist from within inner classJava inner class and static nested classCreate ArrayList from arrayHow do I remove repeated elements from ArrayList?Sort ArrayList of custom Objects by propertyHow to deserialize a list using GSON or another JSON library in Java?Update ViewPager dynamically?Can someone show me a simple working implementation of PagerSlidingTabStrip?Jakson polymorphic Enum caseHow to implement parcelable with my custom class containing Hashmap and SparseArray?How to add child(Product) under a child(Store) in Firebase Database using RecyclerView
Is 'contemporary' ambiguous and if so is there a better word?
When did England stop being a Papal fief?
Copy previous line to current line from text file
What happens to the electronic movements at absolute 0?
GitLab account hacked and repo wiped
My first C++ game (snake console game)
Why is my arithmetic with a long long int behaving this way?
Undefined Control Sequence for my 0-norm
What do you call a painting on a wall?
What does "negligible mass" mean in the formulation of geodesics equation?
Can full drive backup be used instead of MSSQL database backup?
What are the advantages of luxury car brands like Acura/Lexus over their sibling non-luxury brands Honda/Toyota?
Blender 2.80 Remove double vertices option gone
Constitutional limitation of criminalizing behavior in US law?
Meaning of the (idiomatic?) expression "seghe mentali"
Speed up this NIntegrate
Could a brown dwarf in our outer solar system remain undetected today?
What is the closest airport to the center of the city it serves?
Why didn't this character get a funeral at the end of Avengers: Endgame?
Can I hide the part of long lines that exceeds the visual line?
Is any special diet an effective treatment of autism?
Has the United States ever had a non-Christian President?
Dihedral group D4 composition with custom labels
Gerrymandering Puzzle - Rig the Election
Add objects to an arraylist from within inner class
Java inner class and static nested classCreate ArrayList from arrayHow do I remove repeated elements from ArrayList?Sort ArrayList of custom Objects by propertyHow to deserialize a list using GSON or another JSON library in Java?Update ViewPager dynamically?Can someone show me a simple working implementation of PagerSlidingTabStrip?Jakson polymorphic Enum caseHow to implement parcelable with my custom class containing Hashmap and SparseArray?How to add child(Product) under a child(Store) in Firebase Database using RecyclerView
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am writing an app to fetch data from my online database using a callback function to a RecyclerView in my fragment. As you will see in my code below I have tried to show all the relevant pieces of code that are responsible for my final result down there. Should you require more information please ask so that I may provide it.
Here is one class called Question.java
public class Question
public Integer postid;
public String title;
public String content;
public String tags;
public String created;
then the callback class: CallbackQuestions.java
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.example.myapp;
public class CallbackQuestions implements Serializable
public int total = -1;
public List<Question> data = new ArrayList<>();
My ItemModel class: ItemModel.java
public class ItemModel
private String Title;
private String Description;
private String Tags;
private String Created;
public ItemModel(String Title, String Description, String Tags, String Created)
this.Title = Title;
this.Description = Description;
this.Tags = Tags;
this.Created = Created;
public String getCreated()
return Created;
public void setCreated(String Created)
this.Created = Created;
public String getTitle()
return Title;
public void setTitle(String Title)
this.Title = Title;
public String getDescription()
return Description;
public void setDescription(String Description)
this.Description = Description;
public String getTags()
return Tags;
public void setTags(String Tags)
this.Tags = Tags;
Then lastly here is what is giving me headache to get it working ListingModel.java
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position)
ListingModel listingModel = mArrayList.get(position);
((NormalViewHolder) holder).tv_card_header.setText(mArrayList.get(position).getHeader());
((NormalViewHolder) holder).listing_recycler_view.setHasFixedSize(true);
RecyclerView.LayoutManager normalLayoutManager = new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false);
((NormalViewHolder) holder).listing_recycler_view.setLayoutManager(normalLayoutManager);
ArrayList<ItemModel> list = loadQuestionsList();
ItemAdapter itemAdapter = new ItemAdapter(list);
((NormalViewHolder) holder).listing_recycler_view.setAdapter(itemAdapter);
Log.d("MyAdapter", "position: " + position);
public ArrayList<ItemModel> loadQuestionsList()
final ArrayList<ItemModel> mArrayList = new ArrayList<>();
int start = 0;
String sort = "recent";
API api = CallJson.callJson();
Call<CallbackPosts> callbackQuestionsCall = api.QuestionsAll(BaseUrlConfig.RequestLoadMore, start, sort);
callbackQuestionsCall.enqueue(new Callback<CallbackQuestions>()
@Override
public void onResponse(Call<CallbackQuestions> call, Response<CallbackQuestions> response)
CallbackQuestions callbackQuestions = response.body();
for (QuestionsAll thisQuestion : callbackQuestions.data)
mArrayList.add(new ItemModel(thisQuestion.Title, thisQuestion.Description, thisQuestion.Tags, thisQuestion.Created));
myArrayList = mArrayList;
@Override
public void onFailure(Call<CallbackQuestions> call, Throwable t)
if (!call.isCanceled());
);
return myArrayList;
The problem is that my ArrayLists is not returning anything at all despite the callback running successfully as per logs. I would appreciate your help so much.
java
add a comment |
I am writing an app to fetch data from my online database using a callback function to a RecyclerView in my fragment. As you will see in my code below I have tried to show all the relevant pieces of code that are responsible for my final result down there. Should you require more information please ask so that I may provide it.
Here is one class called Question.java
public class Question
public Integer postid;
public String title;
public String content;
public String tags;
public String created;
then the callback class: CallbackQuestions.java
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.example.myapp;
public class CallbackQuestions implements Serializable
public int total = -1;
public List<Question> data = new ArrayList<>();
My ItemModel class: ItemModel.java
public class ItemModel
private String Title;
private String Description;
private String Tags;
private String Created;
public ItemModel(String Title, String Description, String Tags, String Created)
this.Title = Title;
this.Description = Description;
this.Tags = Tags;
this.Created = Created;
public String getCreated()
return Created;
public void setCreated(String Created)
this.Created = Created;
public String getTitle()
return Title;
public void setTitle(String Title)
this.Title = Title;
public String getDescription()
return Description;
public void setDescription(String Description)
this.Description = Description;
public String getTags()
return Tags;
public void setTags(String Tags)
this.Tags = Tags;
Then lastly here is what is giving me headache to get it working ListingModel.java
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position)
ListingModel listingModel = mArrayList.get(position);
((NormalViewHolder) holder).tv_card_header.setText(mArrayList.get(position).getHeader());
((NormalViewHolder) holder).listing_recycler_view.setHasFixedSize(true);
RecyclerView.LayoutManager normalLayoutManager = new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false);
((NormalViewHolder) holder).listing_recycler_view.setLayoutManager(normalLayoutManager);
ArrayList<ItemModel> list = loadQuestionsList();
ItemAdapter itemAdapter = new ItemAdapter(list);
((NormalViewHolder) holder).listing_recycler_view.setAdapter(itemAdapter);
Log.d("MyAdapter", "position: " + position);
public ArrayList<ItemModel> loadQuestionsList()
final ArrayList<ItemModel> mArrayList = new ArrayList<>();
int start = 0;
String sort = "recent";
API api = CallJson.callJson();
Call<CallbackPosts> callbackQuestionsCall = api.QuestionsAll(BaseUrlConfig.RequestLoadMore, start, sort);
callbackQuestionsCall.enqueue(new Callback<CallbackQuestions>()
@Override
public void onResponse(Call<CallbackQuestions> call, Response<CallbackQuestions> response)
CallbackQuestions callbackQuestions = response.body();
for (QuestionsAll thisQuestion : callbackQuestions.data)
mArrayList.add(new ItemModel(thisQuestion.Title, thisQuestion.Description, thisQuestion.Tags, thisQuestion.Created));
myArrayList = mArrayList;
@Override
public void onFailure(Call<CallbackQuestions> call, Throwable t)
if (!call.isCanceled());
);
return myArrayList;
The problem is that my ArrayLists is not returning anything at all despite the callback running successfully as per logs. I would appreciate your help so much.
java
Looks like there is something either missing or not in its right place
– Jack Siro
Mar 23 at 3:00
1
loadQuestionsList will always return an empty list; because it will reach the return statement before the code inside onResponse gets executed. Read about Asynchronous Callbacks.
– 3li
Mar 23 at 3:22
would you mind helping me out on fixing it?
– user8000738
Mar 23 at 3:41
add a comment |
I am writing an app to fetch data from my online database using a callback function to a RecyclerView in my fragment. As you will see in my code below I have tried to show all the relevant pieces of code that are responsible for my final result down there. Should you require more information please ask so that I may provide it.
Here is one class called Question.java
public class Question
public Integer postid;
public String title;
public String content;
public String tags;
public String created;
then the callback class: CallbackQuestions.java
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.example.myapp;
public class CallbackQuestions implements Serializable
public int total = -1;
public List<Question> data = new ArrayList<>();
My ItemModel class: ItemModel.java
public class ItemModel
private String Title;
private String Description;
private String Tags;
private String Created;
public ItemModel(String Title, String Description, String Tags, String Created)
this.Title = Title;
this.Description = Description;
this.Tags = Tags;
this.Created = Created;
public String getCreated()
return Created;
public void setCreated(String Created)
this.Created = Created;
public String getTitle()
return Title;
public void setTitle(String Title)
this.Title = Title;
public String getDescription()
return Description;
public void setDescription(String Description)
this.Description = Description;
public String getTags()
return Tags;
public void setTags(String Tags)
this.Tags = Tags;
Then lastly here is what is giving me headache to get it working ListingModel.java
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position)
ListingModel listingModel = mArrayList.get(position);
((NormalViewHolder) holder).tv_card_header.setText(mArrayList.get(position).getHeader());
((NormalViewHolder) holder).listing_recycler_view.setHasFixedSize(true);
RecyclerView.LayoutManager normalLayoutManager = new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false);
((NormalViewHolder) holder).listing_recycler_view.setLayoutManager(normalLayoutManager);
ArrayList<ItemModel> list = loadQuestionsList();
ItemAdapter itemAdapter = new ItemAdapter(list);
((NormalViewHolder) holder).listing_recycler_view.setAdapter(itemAdapter);
Log.d("MyAdapter", "position: " + position);
public ArrayList<ItemModel> loadQuestionsList()
final ArrayList<ItemModel> mArrayList = new ArrayList<>();
int start = 0;
String sort = "recent";
API api = CallJson.callJson();
Call<CallbackPosts> callbackQuestionsCall = api.QuestionsAll(BaseUrlConfig.RequestLoadMore, start, sort);
callbackQuestionsCall.enqueue(new Callback<CallbackQuestions>()
@Override
public void onResponse(Call<CallbackQuestions> call, Response<CallbackQuestions> response)
CallbackQuestions callbackQuestions = response.body();
for (QuestionsAll thisQuestion : callbackQuestions.data)
mArrayList.add(new ItemModel(thisQuestion.Title, thisQuestion.Description, thisQuestion.Tags, thisQuestion.Created));
myArrayList = mArrayList;
@Override
public void onFailure(Call<CallbackQuestions> call, Throwable t)
if (!call.isCanceled());
);
return myArrayList;
The problem is that my ArrayLists is not returning anything at all despite the callback running successfully as per logs. I would appreciate your help so much.
java
I am writing an app to fetch data from my online database using a callback function to a RecyclerView in my fragment. As you will see in my code below I have tried to show all the relevant pieces of code that are responsible for my final result down there. Should you require more information please ask so that I may provide it.
Here is one class called Question.java
public class Question
public Integer postid;
public String title;
public String content;
public String tags;
public String created;
then the callback class: CallbackQuestions.java
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import com.example.myapp;
public class CallbackQuestions implements Serializable
public int total = -1;
public List<Question> data = new ArrayList<>();
My ItemModel class: ItemModel.java
public class ItemModel
private String Title;
private String Description;
private String Tags;
private String Created;
public ItemModel(String Title, String Description, String Tags, String Created)
this.Title = Title;
this.Description = Description;
this.Tags = Tags;
this.Created = Created;
public String getCreated()
return Created;
public void setCreated(String Created)
this.Created = Created;
public String getTitle()
return Title;
public void setTitle(String Title)
this.Title = Title;
public String getDescription()
return Description;
public void setDescription(String Description)
this.Description = Description;
public String getTags()
return Tags;
public void setTags(String Tags)
this.Tags = Tags;
Then lastly here is what is giving me headache to get it working ListingModel.java
@Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position)
ListingModel listingModel = mArrayList.get(position);
((NormalViewHolder) holder).tv_card_header.setText(mArrayList.get(position).getHeader());
((NormalViewHolder) holder).listing_recycler_view.setHasFixedSize(true);
RecyclerView.LayoutManager normalLayoutManager = new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false);
((NormalViewHolder) holder).listing_recycler_view.setLayoutManager(normalLayoutManager);
ArrayList<ItemModel> list = loadQuestionsList();
ItemAdapter itemAdapter = new ItemAdapter(list);
((NormalViewHolder) holder).listing_recycler_view.setAdapter(itemAdapter);
Log.d("MyAdapter", "position: " + position);
public ArrayList<ItemModel> loadQuestionsList()
final ArrayList<ItemModel> mArrayList = new ArrayList<>();
int start = 0;
String sort = "recent";
API api = CallJson.callJson();
Call<CallbackPosts> callbackQuestionsCall = api.QuestionsAll(BaseUrlConfig.RequestLoadMore, start, sort);
callbackQuestionsCall.enqueue(new Callback<CallbackQuestions>()
@Override
public void onResponse(Call<CallbackQuestions> call, Response<CallbackQuestions> response)
CallbackQuestions callbackQuestions = response.body();
for (QuestionsAll thisQuestion : callbackQuestions.data)
mArrayList.add(new ItemModel(thisQuestion.Title, thisQuestion.Description, thisQuestion.Tags, thisQuestion.Created));
myArrayList = mArrayList;
@Override
public void onFailure(Call<CallbackQuestions> call, Throwable t)
if (!call.isCanceled());
);
return myArrayList;
The problem is that my ArrayLists is not returning anything at all despite the callback running successfully as per logs. I would appreciate your help so much.
java
java
edited Mar 24 at 0:36
Sagar Poshiya
141311
141311
asked Mar 23 at 2:57
user8000738
Looks like there is something either missing or not in its right place
– Jack Siro
Mar 23 at 3:00
1
loadQuestionsList will always return an empty list; because it will reach the return statement before the code inside onResponse gets executed. Read about Asynchronous Callbacks.
– 3li
Mar 23 at 3:22
would you mind helping me out on fixing it?
– user8000738
Mar 23 at 3:41
add a comment |
Looks like there is something either missing or not in its right place
– Jack Siro
Mar 23 at 3:00
1
loadQuestionsList will always return an empty list; because it will reach the return statement before the code inside onResponse gets executed. Read about Asynchronous Callbacks.
– 3li
Mar 23 at 3:22
would you mind helping me out on fixing it?
– user8000738
Mar 23 at 3:41
Looks like there is something either missing or not in its right place
– Jack Siro
Mar 23 at 3:00
Looks like there is something either missing or not in its right place
– Jack Siro
Mar 23 at 3:00
1
1
loadQuestionsList will always return an empty list; because it will reach the return statement before the code inside onResponse gets executed. Read about Asynchronous Callbacks.
– 3li
Mar 23 at 3:22
loadQuestionsList will always return an empty list; because it will reach the return statement before the code inside onResponse gets executed. Read about Asynchronous Callbacks.
– 3li
Mar 23 at 3:22
would you mind helping me out on fixing it?
– user8000738
Mar 23 at 3:41
would you mind helping me out on fixing it?
– user8000738
Mar 23 at 3:41
add a comment |
1 Answer
1
active
oldest
votes
I think i agree with the comment you got on earlier, your function will always return an empty list. Asynchronous calls don't work that way. There is no return value.
Don't make API calls inside the ListingModel. Fetch the data first. Then pass it into the ListingModel. You can have an update() method that receives the list of items fetched and forces a refresh of the ListingModel.
On ItemAdapter create a method that set the list and notify the adapter to refresh by calling notifyDataSetChanged(); Then call that method inside the success response if the list fetched is not empty. i.e itemAdapter.setList(myArrayList).
thanks for this advice I will surely try to fix it the way you have suggested
– user8000738
Mar 24 at 9:38
You are welcome and if the solution helps you fix the please don't forget to accept my answer as correct one
– Jack Siro
Mar 24 at 9:40
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310185%2fadd-objects-to-an-arraylist-from-within-inner-class%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think i agree with the comment you got on earlier, your function will always return an empty list. Asynchronous calls don't work that way. There is no return value.
Don't make API calls inside the ListingModel. Fetch the data first. Then pass it into the ListingModel. You can have an update() method that receives the list of items fetched and forces a refresh of the ListingModel.
On ItemAdapter create a method that set the list and notify the adapter to refresh by calling notifyDataSetChanged(); Then call that method inside the success response if the list fetched is not empty. i.e itemAdapter.setList(myArrayList).
thanks for this advice I will surely try to fix it the way you have suggested
– user8000738
Mar 24 at 9:38
You are welcome and if the solution helps you fix the please don't forget to accept my answer as correct one
– Jack Siro
Mar 24 at 9:40
add a comment |
I think i agree with the comment you got on earlier, your function will always return an empty list. Asynchronous calls don't work that way. There is no return value.
Don't make API calls inside the ListingModel. Fetch the data first. Then pass it into the ListingModel. You can have an update() method that receives the list of items fetched and forces a refresh of the ListingModel.
On ItemAdapter create a method that set the list and notify the adapter to refresh by calling notifyDataSetChanged(); Then call that method inside the success response if the list fetched is not empty. i.e itemAdapter.setList(myArrayList).
thanks for this advice I will surely try to fix it the way you have suggested
– user8000738
Mar 24 at 9:38
You are welcome and if the solution helps you fix the please don't forget to accept my answer as correct one
– Jack Siro
Mar 24 at 9:40
add a comment |
I think i agree with the comment you got on earlier, your function will always return an empty list. Asynchronous calls don't work that way. There is no return value.
Don't make API calls inside the ListingModel. Fetch the data first. Then pass it into the ListingModel. You can have an update() method that receives the list of items fetched and forces a refresh of the ListingModel.
On ItemAdapter create a method that set the list and notify the adapter to refresh by calling notifyDataSetChanged(); Then call that method inside the success response if the list fetched is not empty. i.e itemAdapter.setList(myArrayList).
I think i agree with the comment you got on earlier, your function will always return an empty list. Asynchronous calls don't work that way. There is no return value.
Don't make API calls inside the ListingModel. Fetch the data first. Then pass it into the ListingModel. You can have an update() method that receives the list of items fetched and forces a refresh of the ListingModel.
On ItemAdapter create a method that set the list and notify the adapter to refresh by calling notifyDataSetChanged(); Then call that method inside the success response if the list fetched is not empty. i.e itemAdapter.setList(myArrayList).
answered Mar 23 at 20:04
Jack SiroJack Siro
1
1
thanks for this advice I will surely try to fix it the way you have suggested
– user8000738
Mar 24 at 9:38
You are welcome and if the solution helps you fix the please don't forget to accept my answer as correct one
– Jack Siro
Mar 24 at 9:40
add a comment |
thanks for this advice I will surely try to fix it the way you have suggested
– user8000738
Mar 24 at 9:38
You are welcome and if the solution helps you fix the please don't forget to accept my answer as correct one
– Jack Siro
Mar 24 at 9:40
thanks for this advice I will surely try to fix it the way you have suggested
– user8000738
Mar 24 at 9:38
thanks for this advice I will surely try to fix it the way you have suggested
– user8000738
Mar 24 at 9:38
You are welcome and if the solution helps you fix the please don't forget to accept my answer as correct one
– Jack Siro
Mar 24 at 9:40
You are welcome and if the solution helps you fix the please don't forget to accept my answer as correct one
– Jack Siro
Mar 24 at 9:40
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310185%2fadd-objects-to-an-arraylist-from-within-inner-class%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Looks like there is something either missing or not in its right place
– Jack Siro
Mar 23 at 3:00
1
loadQuestionsList will always return an empty list; because it will reach the return statement before the code inside onResponse gets executed. Read about Asynchronous Callbacks.
– 3li
Mar 23 at 3:22
would you mind helping me out on fixing it?
– user8000738
Mar 23 at 3:41