I have problem to show the friend name on my chat. the apps force close every time run to show the friend\'s name. if i comment the part for friend\'s name, the messages can app
All your setText, Toast, etc... actions should be done in the UI thread.
For instance, stuff like: friendLabel.setText(name);
In order to fix that, I would suggest you to do that inside the onPostExecute:
@Override
protected void onPostExecute(JSONArray result) {
updateUI();// Do whatever you want here
}
From: http://developer.android.com/reference/android/os/AsyncTask.html
onPostExecute(Result), invoked on the UI thread after the background computation finishes. The result of the background computation is passed to this step as a parameter.