I"m trying to read contacts from phone on button click
but i'm getting the error "Can't create handler inside thread that has not called Looper.prepare()"
pDialog = new ProgressDialog(this);
pDialog.setMessage("Reading contacts...");
pDialog.setCancelable(false);
updateBarHandler = new Handler();
//putting read contacts on a separate thread
mPickContact.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new Thread(new Runnable() {
@Override
public void run() {
pDialog.show();
getContacts();
}
}).start();
}