i have this code which onlt select from parse all the data, afer it succedd i wish to show this data in a view i made for it, when i set all the text views it shows this in my app :
this is my code :
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sharing_board);
Parse.initialize(this, "******", "******");
//Set up the listview
ArrayList<String> sharingList = new ArrayList<String>();
//Create and populate an ArrayList of objects from parse
listAdapter = new ArrayAdapter<View>(this, android.R.layout.simple_list_item_1);
ListView SharingListView = (ListView)findViewById(R.id.listView1);
SharingListView.setAdapter(listAdapter);
final ParseQuery query = new ParseQuery("SharingBoard");
Inflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
query.findInBackground(new FindCallback<ParseObject>()
{
public void done(List<ParseObject> objects, ParseException e)
{
if (e == null)
{
for (int i = 0; i < objects.size(); i++)
{
Object object = objects.get(i);
String name = ((ParseObject) object).getString("Name").toString();
String part = ((ParseObject) object).getString("Part").toString();
String desc = ((ParseObject) object).getString("Desc").toString();
View view = Inflater.inflate(R.layout.item_list, null);
// Add the name view
TextView nameTextView = (TextView) view.findViewById(R.id.lblName);
nameTextView.setText(name);
// Add the part view
TextView partTextView = (TextView) view.findViewById(R.id.lblPart);
partTextView.setText(part);
// Add the desc view
TextView descTextView = (TextView) view.findViewById(R.id.lblDesc);
descTextView.setText(desc);
listAdapter.add(view);
}
}
else
{
Log.d("error", e.toString());
Toast.makeText(getApplicationContext(), "Error", Toast.LENGTH_LONG).show();
}
}
});
what do i do wrong ? thanks...