java.lang.RuntimeException: Unable to start activity ComponentInfo: java.lang.NullPointerException: storage == null

核能气质少年 提交于 2019-11-29 01:21:41

This particular exception ("storage == null") is thrown when the array parameter passed to ArrayAdapter(Context, int, T[]) is null. (To be more specific, it's thrown from Arrays.java when it tries to create a new ArrayList wrapped around your null array.)

There should be no problem with the variable values itself, but are you absolutely sure that values is not null at the point you're passing it into the ArrayAdapter constructor? Just below the line

  //Log.i("User Name",uname);

and just above the constructor call, add something like this:

  Log.i("FriendsActivity", "values = <<" + values + ">>");

and see if it really is what it's supposed to be.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!