Unable to start activity ComponentInfo{com.asis.main/com.asis.main.show.ShowListActivity}:

解决方案 »

  1.   

    空指针最容易排查了,你看看你的ShowListActivity的64行
      

  2.   

    老哥,这是53-74的码,64就是一个for;56就是showCategoryDishes(Cotegory);        String Cotegory = intent.getStringExtra("Cotegory");
            dbUtil = DBUtil.getInstance(databasePath);
    dbUtil.openDB();
    showCategoryDishes(Cotegory);
    }



    public  void showCategoryDishes(String Cotegory){
    Dishes[] dishes = dbUtil.queryCategory(Cotegory);
       data=new ArrayList<HashMap<String,String>>();
    for(int i=0;i<dishes.length;i++){
    HashMap<String, String> map=new HashMap<String, String>();
    map.put("diahes_name",dishes[i].getDishes());
    map.put("dishes_material",dishes[i].getIngredient());
    data.add(map);

    }
    MyAdapter adapter=new MyAdapter(this,data, R.layout.list_item_custom, 
    new String[]{"diahes_name","dishes_material"},
    new int[]{R.id.name,R.id.txtstr});
    list.setAdapter(adapter);
      

  3.   

    你输出一下 dishes 是不是 null 
      

  4.   

    那你就要去看看你的 dbUtil.queryCategory(Cotegory); 方法执行为什么会返回 null 了,例如没有权限之类的