07-17 15:51:16.429: D/visibility(10457): android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
07-17 15:51:21.339: D/visibility(10457): android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
07-17 15:51:32.309: D/visibility(10457): android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
07-17 15:51:40.604: D/visibility(10457): android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
私のコード:
try {
for (int i = 0; i < jArray.length(); i++) {
JSONObject json = jArray.getJSONObject(0);
String jsona = json.getString("Email");
if (jsona == null) {
goodrating.setVisibility(View.VISIBLE);
badrating.setVisibility(View.VISIBLE);
} else {
goodrating.setVisibility(View.GONE);
badrating.setVisibility(View.GONE);
}
}
} catch (Exception e) {
Log.d("visibility", e.toString());
}
これらのコードはASYNCTASK DOINBACKGROUND にあるのに、なぜこのエラーが発生するのですか?