开发者

throwing null pointer exception ,want to display content provider save item in list view using base adapter

开发者 https://www.devze.com 2023-03-11 05:58 出处:网络
dear i save the data in content provider and fetch using cursor object and want to display in list view using base adapt开发者_JAVA百科er but it is throwing \"NULL POINTER EXCEPTION \" i dont understo

dear i save the data in content provider and fetch using cursor object and want to display in list view using base adapt开发者_JAVA百科er but it is throwing "NULL POINTER EXCEPTION " i dont understood ehy bcoz i am showing value in log cat it display and after i store these values in array using for loop ,please take a look in my code, and debug pls where i m wrong.

static String id = null;
static String userName = null;
static String[] usr;
@Override

}


You never initialized the array usr, so it's still null. Consider adding before the loop:

usr = new String[id.length()];
0

精彩评论

暂无评论...
验证码 换一张
取 消