i have class named register_information looks
// getting name public string get_name() { return this.name; } // setting name public void set_name(string name) { this.name=name; } i used code of name , password registered mainactivity this.
list<register_information> all_reg_info_lists = db.get_all_info(); list<hashmap<string, string>> list_of_reg_info = new arraylist<hashmap<string, string>>(); (register_information reg_info : all_reg_info_lists) { hashmap<string, string> hm = new hashmap<string, string>(); string name = reg_info.get_name(); string password=reg_info.get_password() ; hm.put("key_name",name); hm.put("key_password",password); list_of_reg_info.add(hm); } now want pass these name , password window showing them list-view intent. used intent
intent intobj = new intent(mainactivity.this,showdata_in_textview_class.class); intobj.putextra("data", list_of_reg_info); startactivity(intobj); in showdata_in_textview_class received intent this
public class showdata_in_textview_class extends activity{ arrayadapter adapter; list<register_information> reg_info_lists; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.listview_xml_page); intent intename = getintent(); reg_info_lists= (list)intename.getserializableextra("data"); } }
but didn't work. how can that??
Comments
Post a Comment