Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid - Parse.com retrieve the whole object of a query and display in ArrayList
    text
    copied!<p>In the following code I search HighScore class for the best time results ordered by ascending. So I'm getting list of best results. What I having a difficulty is to add the name and the school name to of each time result to the list.(please see the attached images)</p> <pre><code>private class RemoteDataTask extends AsyncTask&lt;Void, Void, Void&gt; { // Override this method to do custom remote calls protected Void doInBackground(Void... params) { // Gets the current list of bestTime in sorted order ParseQuery query = new ParseQuery("TestsTopRecords"); query.orderByAscending("bestTime"); try { results = query.find(); } catch (ParseException e) { } return null; } @Override protected void onPreExecute() { HighScoreTable.this.progressDialog = ProgressDialog.show(HighScoreTable.this, "", "Loading...", true); super.onPreExecute(); } @Override protected void onProgressUpdate(Void... values) { super.onProgressUpdate(values); } @Override protected void onPostExecute(Void result) { // Put the list of results into the list view ArrayAdapter&lt;Double&gt; adapter = new ArrayAdapter&lt;Double&gt;(HighScoreTable.this,R.layout.todo_row); for (ParseObject object : results) { adapter.add((Double) object.get("bestTime")); } setListAdapter(adapter); HighScoreTable.this.progressDialog.dismiss(); TextView empty = (TextView) findViewById(android.R.id.empty); empty.setVisibility(View.VISIBLE); } } /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_high_score_table); TextView empty = (TextView) findViewById(android.R.id.empty); empty.setVisibility(View.INVISIBLE); new RemoteDataTask().execute(); registerForContextMenu(getListView()); } </code></pre> <p><img src="https://i.stack.imgur.com/pzZEX.png" alt="How I would like it to look like"></p> <p><img src="https://i.stack.imgur.com/vpJxC.png" alt="ScreenShot of the Prase.com DataBase"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload