Hello i am developing a post tracking application and my main tracking info query is based on parsing the info from html url connection using jsoup however i am facing a small issue. when i establish connection to the url and getting the entire text from the website i get result of "please wait while tracking info is retrieved" it is probably because the connection is immidiate but in my case i need to connect and wait a few seconds until the info is retrieve.so my question is What is the right approach for this? thanks in advance
public class gettracking extends AsyncTask<Void,Void,Void> {
String status,TAG="trackingquery";
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
}
@Override
protected Void doInBackground(Void... voids) {
try {
Document doc = Jsoup.connect("http://www.israelpost.co.il/itemtrace.nsf/mainsearch?OpenForm&L=HE&itemcode=RR123456789IL").get();
status =doc.text();
Log.d(TAG,status);
}catch (Exception e){
e.printStackTrace();
}
return null;
}
}
}