爲了我一直在使用下面的代碼來創建一個列表視圖:問題的ListView
public class AndroidJSONParsingActivity extends ListActivity {
// url to make request
private static String url = "http://api.androidhive.info/contacts/";
// JSON Node names
private static final String TAG_CONTACTS = "contacts";
private static final String TAG_ID = "id";
private static final String TAG_NAME = "name";
private static final String TAG_EMAIL = "email";
private static final String TAG_ADDRESS = "address";
private static final String TAG_GENDER = "gender";
private static final String TAG_PHONE = "phone";
private static final String TAG_PHONE_MOBILE = "mobile";
private static final String TAG_PHONE_HOME = "home";
private static final String TAG_PHONE_OFFICE = "office";
這一個以上的作品,但如果我把它變成:
private static String url = "http://kondicioner.al/app/json.php";
// JSON Node names
private static final String TAG_CONTACTS = "contacts";
private static final String TAG_ID = "id";
private static final String TAG_NAME = "emer";
private static final String TAG_EMAIL = "mbiemer";
private static final String TAG_ADDRESS = "telefon";
private static final String TAG_GENDER = "adresa";
private static final String TAG_PHONE = "ora";
private static final String TAG_PHONE_MOBILE = "per";
private static final String TAG_PHONE_HOME = "dyqan";
private static final String TAG_PHONE_OFFICE = "statusi";
它不會工作now.I不理解可能是什麼問題,它應該工作,相同的結構相同的東西... 謝謝
不同的JSON? – Blackbelt
究竟是什麼問題?它會崩潰嗎?字段是空的? – Gomoku7
是的,領域是空的! JSON是不同的,但我修改了它.. – alandr