So I'm looking for a simple way to display all values of a row with a given objectID. I feel like this should be very straight forward- I've read through the Android help section and maybe I'm looking right past it but I've tried for quite a while and can't get it.
ObID | value 1 | value 2 | value 3
xxxxx | a | b | c
As an example, I want to provide "xxxxx" and then have my listview display "a,b,c". I've tried a query with the following:
@Override
public void onClick(View v) {
masterList.removeAll(masterList);
ParseQuery<ParseObject> columnQuery = new ParseQuery<ParseObject>("MasterTable");
columnQuery.whereEqualTo("objectId", "vqWGQa6lPT");
masterListView.setAdapter(adapter);
columnQuery.findInBackground(new FindCallback <ParseObject> (){
@Override
public void done(List<ParseObject> objects, ParseException e) {
if(e==null){
for( int i = 0; i < objects.size() ; i++) {
Toast.makeText(getApplicationContext(), "Search Successful!", Toast.LENGTH_SHORT).show();
//Searches list under the company currently typed into "Company" (AUTOFIND SO STRING SPELLED CORRECTLY!!!)
masterList.add(objects.get(i).getString("color"));
masterList.add(objects.get(i).getString("companyOne"));
This is the only way I've had luck but it sort of defeats the purpose as to get it to display any of the column names I have to physically type them in.
***************[EDIT ON 2/9/15]****************************************
Here's my table from Parse.com
The code Varun provided me returns the following output in my listview:
Color :'green', CompanyName:'g1'
Color:'greenTwo', CompanyName:g2;
Color:'red',CompanyName:r1
Color:'RedTwo',CompanyName:r2
Color:'COLOR',CompanyName:companyOne
So this is querying my table and providing me the data FROM THE COLUMN. What I want is to return the ROW data. So per my table above what I WOULD WANT TO SEE would be the following:
EX:
ObjectID selected: 9jRcxICwgt
ListView relations would display:
'greenTwo' paired with 'color'
'g2' paired with 'companyOne'
'gg2' paired with 'companyTwo'
'ggg2' paired with 'companyThree'
I plan on having boat loads of company so I figured theres an easier way to query the companies without typing in "companyOne", "CompanyTwo", etc... for EVERY company I have in both my table as well as my code. I would just assuming I could input the objectID and then return all row data for everything matching that.