In my app I'm getting some TEXT
from a Website by ion library and I'm using a progressBar
to show the progress of downloading that data.
But my main issue is that in onComplete
I implemented some methods that work with the TEXT
I've got from the website these are some cyclic methdods that use lot's of for and other stuff and actually my progressBar
at the beginning works properly, but when it's complete downloading the data the progressBar
just sticks until all the methods are complete in onComplete()
.
I would that the progressBar
runs anyway and doesn't get stuck without removing methods from onComplete()
is it possible?
Here is my function where I use ion library that I invoke in the onClick()
event:
private void getHTML(){
progressDialog = new SpotsDialog(MainActivity.this, R.style.Custom);
progressDialog.show();
Ion.with(getApplicationContext())
.load("IP")
.asString()
.setCallback(new FutureCallback<String>() {
@SuppressLint("SetTextI18n")
@Override
public void onCompleted(Exception e, String result) {
htmlresultart = result;
htmlresultart = htmlresultart.replace("</td>", "\n");
getTable();
getHeader();
getBody();
progressDialog.cancel();
}
});
}