Saturday 15 March 2014

parse.com - How to do a query in Android using Parse? -


My class is called "MyClass" in pars and it has many objects like

 < Code> | Object ID | Name | Owners | User | (The owner is indicative of another class)   

I want to do a query which gives me all the names related to the owners in my name "name", but when I do this I query this Get:

  com.parse.ParseObject@41828fe0 com.parse.ParseObject@41829fdd com.parse.ParseObject@4182aa28   

my code is it

  final parseQuery query = new parse ("MyClass"); Query.whereEqualTo ("Owners", ParseUser.getCurrentUser ()); Query.findInBackground (New FindCallback () {Public Zero (list of & lt; ParseObject & gt; MyList, ParseException e) {if (E == faucet) {Adapter = New ArrayAdapter & lt; ParseObject & gt; (MyActivity This, android.R.layout.simple_list_item_1, MyList); listDev.setAdapter (adapter);} else {// error}   

Please help me how to query what I own Returns all the names related to. / P>

Edit I have found a solution and something like that.

  Parsequator    

Your real problem here is your array adapter. If you want to use parse objects as your data type, you will need a custom adapter. The built-in adapter does not know how to use a parsed object and output the object as a string for you. Instead you should do something like

arrayAdapter = new ArrayAdapter (this, android.R.layout.simple_list_item_1, MyNamesList);

Where MyNamesList is of type string .

It is difficult to help your query without much information, but you are getting back the pars objects, you just need to get something by them in such a name

Get MyList (I) .getString ("name");

No comments:

Post a Comment