1
Process: com.example.venky.httpurl1, PID: 2578 java.lang.RuntimeException: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 3 path $[0]錯誤:預期BEGIN_ARRAY但BEGIN_OBJECT
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
listView = (ListView) findViewById(R.id.rtlist);
client = new AsyncHttpClient();
client.get(MainActivity.this, url, new com.loopj.android.http.AsyncHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, cz.msebera.android.httpclient.Header[] headers, byte[] responseBody) {
String responsestr = new String(responseBody);
gson = new Gson();
responseObj = gson.fromJson(responsestr, Response.class);
adapter = new CustomAdapter(MainActivity.this, responseObj);
listView.setAdapter(adapter);
}
任何輸入,請? 是因爲我的JSON數據?