Categorylist = new ArrayList<CategoryModel>();
try {
JSONArray jsonArray = new JSONArray(category());
Log.i(CategoryActivity.class.getName(), "Number of entries "
+ jsonArray.length());
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
if (jsonObject == null)
return null;
我尝试了这段代码,但它给出了错误请建议我一个最好的方法来做到这一点