i have arraylist 60-70 elements in it. set adapter autocompletetextview follows.
autocompletetextview mrecipient = (autocompletetextview) this.findviewbyid(r.id.recipient); mrecipient.setthreshold(1); log.i("array list", ""+names);// here got arraylist arrayadapter<string> nameadapter=new arrayadapter<string>(myclass.this, android.r.layout.simple_list_item_1, names); mrecipient.setadapter(nameadapter); but dropdown list doesn't show , got warning(not errror) in logcat.
04-21 17:15:53.017: w/filter(15093): exception occured during performfiltering()! 04-21 17:15:53.017: w/filter(15093): java.lang.nullpointerexception 04-21 17:15:53.017: w/filter(15093): @ android.widget.arrayadapter$arrayfilter.performfiltering(arrayadapter.java:437) 04-21 17:15:53.017: w/filter(15093): @ android.widget.filter$requesthandler.handlemessage(filter.java:234) 04-21 17:15:53.017: w/filter(15093): @ android.os.handler.dispatchmessage(handler.java:99) 04-21 17:15:53.017: w/filter(15093): @ android.os.looper.loop(looper.java:123) 04-21 17:15:53.017: w/filter(15093): @ android.os.handlerthread.run(handlerthread.java:60) also have listview below this, empty now.
can figure out warning means?
the warning comes following code snippet in arrayadapter.performfiltering(charsequence):
string prefixstring = prefix.tostring().tolowercase(); // entered user final arraylist<t> values = moriginalvalues; final int count = values.size(); final arraylist<t> newvalues = new arraylist<t>(count); // returned (int = 0; < count; i++) { final t value = values.get(i); // in case, 'value' null @ times final string valuetext = value.tostring().tolowercase(); // warning // first match against whole, non-splitted value if (valuetext.startswith(prefixstring)) { newvalues.add(value); } else { final string[] words = valuetext.split(" "); final int wordcount = words.length; (int k = 0; k < wordcount; k++) { if (words[k].startswith(prefixstring)) { newvalues.add(value); break; } } } } so, check null values in names.
Comments
Post a Comment