Tuesday, February 15, 2011

How to create Loading dialog box


If you want to display progress bar with the dialog box you can use ProgressDialog.

ex-

package com.load;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;

public class loading_box extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ProgressDialog pdialog=new ProgressDialog(this);
pdialog.setCancelable(true);
pdialog.setMessage("Loading ....");
pdialog.show();
setContentView(R.layout.main);
}
}

Sameeraa4ever

No comments:

Post a Comment