About the author
The following code demonstrates how to show a progress dialog while starting up an Android activity. The progress dialog is shown near the end of the creation of the activity. There, a thread is created and started up.
When the thread has finished completion, it queues code to dismiss the progress dialog into the UI thread.
public class listApks extends Activity { ProgressDialog mprogressDialog; private void someTasks() { // run some private code here } private class someTasksThread extends Thread { Handler mHandler; someTasksThread(Handler h) { mHandler = h; } public void run() { // run some stuff here mHandler.post(new Runnable() { @Override public void run() { mprogressDialog.dismiss(); // post results here into the user interface } }); } } /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main);
mprogressDialog = ProgressDialog.show(this, "", "Loading. Please wait...", true); Thread thread = new someTasksThread(new Handler()); thread.start(); }}
How to free more space on your home drive by redirecting the location for SDKs in RAD Studio
Learn the command line used to compile System.pas in Delphi
A method to design records so that they're allocated on a specific byte boundary, such as 16 bytes, 512 bytes, 4096 bytes, etc.
Learn why the map is cool in Go!