J'ai un problème avec mon ListActivity, j'utilise un thread pour afficher un ProgressDialog où obtenir une liste de toutes les applications installées. Je le transforme en un adaptateur de liste et que je veux mettre le listadapter de l'activité mais je ne peux pas faire cela du fil.appel setListAdapter() à partir d'un thread
je reçois l'erreur suivante: ERROR/AndroidRuntime(14429): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
progressDialog = new ProgressDialog(this);
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setMessage("Loading...");
progressDialog.show();
new Thread() {
public void run() {
showList(); // the method where i get all the apps and have the setListAdapter(); method
progressDialog.dismiss();
}
}.start();
Comment puis-je l'obtenir, je peux donc utiliser le setListAdapter à l'intérieur de mon fils
reaaly utile merci ... – Ravi