I was going to set the background of a linear layout from the server URL.
On the main thread, I couldn't get images from the server.
On the AsyncTask, I couldn't set the background of the linear layout.
How can I solve this problem?
Thank you.
I was going to set the background of a linear layout from the server URL.
On the main thread, I couldn't get images from the server.
On the AsyncTask, I couldn't set the background of the linear layout.
How can I solve this problem?
Thank you.
Activities had a runOnUiThread(Runnable action) method where you can update the UI.
AsyncTask:
@Override
protected void onPostExecute(String result) {
listener.updateUi()
}
Activity:
@Override
public void updateUi(String result){
runOnUiThread(() -> {
// Change the UI here
});
}