Search code examples
androidlistviewparse-platformandroid-tablelayout

Retrieving data from parse.com and displaying in a table layout


I am able to retrieve the data, according to the logs, but not sure how to display them. I have created an activity with a table layout and tablerow with a textview to display the categories.

Main Activity

content_recipes.xml

Logs:

Logs


Solution

  • If you just want to generate a prototype, you can use ParseQueryAdapter.

    The code is from Parse.com docs

    // Inside an Activity
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      // Uses a layout with a ListView (id: "listview"), which uses our Adapter.
      setContentView(R.layout.main);
    
      ParseQueryAdapter<ParseObject> adapter = new ParseQueryAdapter<ParseObject>(this, "Instrument");
      adapter.setTextKey("name");
      adapter.setImageKey("photo");
    
      ListView listView = (ListView) findViewById(R.id.listview);
      listView.setAdapter;
    }
    

    https://parse.com/docs/android/guide#user-interface-parsequeryadapter

    https://github.com/ParsePlatform/ParseUI-Android

    You can custom your query by a queryFactory

    https://parse.com/docs/android/guide#user-interface-customizing-the-query

    Or you can custom your XXXAdapter(ListAdapter, ArrayAdapter, BaseAdapter).

    Before call findInBG show a loading animation. Once done be called, set this list to your adapter, and then adapter.notifyDataSetChanged().

    If you are just not familiar with using ListView, you should Google it.