AsyncTask vs Thread Handler
AsyncTask vs Thread Handler This post show how to implement using AsyncTask and Thread/Handler to perform the same function: doing something in background and update UI elements (ProgressBar and TextView). This video show how it run on Android Emulator running Android N, in Multi-Window. AsyncTask MainActivity.java package com.blogspot.android_er.androidasynctask; import android.os.AsyncTask; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.ProgressBar; import android.widget.TextView; public class MainActivity extends AppCompatActivity { Button btnStart; ProgressBar progressBar; TextView textMsg; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); progressBar = (ProgressBar)findViewById(R.id.progress); textMsg = (TextView)findViewById(R.id.msg); btnStart = (Button)findViewById(R.id.st...