android - Listview for multiple selection only shows checkboxes and no data displayed -


I am writing a code to show a multiple selection list (containing a check box) and when user checks an item I want to recover the user's name and id from the database table and display it in toast. Here's the code:

Activity code

  increases the public class Add_To_Circle activity {ListView lv; ListAdapter Optimizer; Override public null on @reate (bundle saved instainstate) {super.naught (savedinstenstate); SetContentView (R.layout.add_to_circle); // get list view lv = (ListView) findViewById (R.id.list); Lv.setChoiceMode (ListView.CHOICE_MODE_MULTIPLE); } ... // All other code, and then in another class in the postexecute is the adapter: Protected void onPostExecute (string file_url) {// Disallow dialog after receiving all products //pDialog.dismiss (); // Updating URI from Background Thread Run Onutath (New Runnabal) (Public Wired Run) (*) * See in the list * Updated JSON data * * / Adapters = New Simple Adapter (Add_To_Circle.this, productsList, android .r.layout Simple_list_item_multiple_choice, new string [] {TAG_PID, TAG_NAME}, new int [] (RIDPID, RIDName}); // listing LVAset adapter (adapter);}}); }}  

XML file's code

  & lt; Relative layout xmlns: android = "http://schemas.android com / apk / res / android" xmlns: tools = "http://schemas.android.com/tools" Android: layout_width = "match_parent" Android: layout_height = "Match_parent" & gt; & Lt; ListView Android: id = "@ + id / list" Android: layout_width = "match_parent" Android: layout_height = "wrap_content" & gt; & Lt; / ListView & gt; & Lt; / RelativeLayout & gt;  

Output: What is wrong with an empty list view with checkboxes which is in attached image? I still have not followed the same steps as the tutorial on the web: ((

You There are links here,

and if you want to use simple array adapter, you can use custom adapter. ,

look at this link,

thanks


Comments