Adding subitem in listview using parse.com through parse query

342 views Asked by At

i have displayed the data in listview from parse, the data that should be displayed is the username as item and bloodgroup of that user as the subitem. my app is displaying the item but i just don't know how to display the subitem. feild names from parse is "username" and "BloodGroup". please how can i display subitem.

here is the code for that

public class donar_list extends Activity {
// Declare Variables
 ListView listview;
 SimpleCursorAdapter adapter;
 List<ParseObject> ob;

   ProgressDialog mProgressDialog;
     // ParseQueryAdapter<ParseObject> adapter;


   @Override
   public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.donar_acceptor_list);

    ParseQueryAdapter.QueryFactory<ParseObject> factory =
             new ParseQueryAdapter.QueryFactory<ParseObject>() {
               public ParseQuery create() {
                 ParseQuery query = new ParseQuery("Data");
                 query.orderByDescending("createdAt");
                 query.whereContains("DonAcc", "donar");
                 return query;
               }
             };

         ParseQueryAdapter<ParseObject> Adapter = newParseQueryAdapter<ParseObject>    (this, factory);
         Adapter.setTextKey("username");
         final ListView listView = (ListView) findViewById(R.id.list);
         listView.setAdapter(Adapter);
      }
    }

For layout

 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent" >

 <ListView
    android:id="@+id/list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    />


 </RelativeLayout>
0

There are 0 answers