java - Getting strange characters from single item of a ListView -


i'm trying getting data listadapter i'm getting stranges values. , cannot re-use values in method.

    private void updatelist() {      listadapter adapter = new simpleadapter(this, mcommentlist,             r.layout.single_post, new string[] { title, message,                     username }, new int[] { r.id.title, r.id.message,                     r.id.username });      setlistadapter(adapter);      final listview lv = getlistview();     lv.setonitemclicklistener(new onitemclicklistener() {          @override         public void onitemclick(adapterview<?> parent, view view,                 int position, long id) {              string aux = (string) lv.getitematposition(position).tostring();               //to display "you clicked @ {message=hello, username=myself, title=hello }"              toast.maketext(readcomments.this, "you clicked @ " + aux, toast.length_short).show();              //i want display "myself" (the content of username), strange values lot of numbers.             //"you clicked @ android.widget.textview{b40a1c10 v.ed ..........5,35-45,56#7f060002 app:id/message}              toast.maketext(readcomments.this, "you clicked @ " + view.findviewbyid(r.id.message).tostring(), toast.length_short).show();          }     }); } 

how can use "myself" item in method , performance toast message? ideas?

lv.getitematposition(position) returns map object put in list. below code believe should work;

map map = (map) lv.getitematposition(position);  string title = map.get("title"); string message = map.get("message"); string username= map.get("username"); 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -