when i run
msgcheck.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(msgcheck.isChecked()){
//hedearMsg
final Dialog dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dialog.setContentView(R.layout.custommsg);
dialog.setCancelable(true);
dialog.show();
Thread t = new Thread() {
public void run() {
// Do something on another thread
PopulatePeopleList();
}
};
t.run();
}
});
my program hang a few second and then show dialog
i want run this dialog without hanging and PopulatePeopleListfunc work anyone idea?
Threads are started with
start, notrun:runwill just call therunmethod sequentially on the main thread.