Search Results

Search found 2 results on 1 pages for 'mrwienerdog'.

Page 1/1 | 1 

  • Trying to populate ListView in Android using objects from Parse

    - by mrwienerdog
    I am pretty darned new to android, and VERY new to Parse. I have created a class, StudentInformation, that includes columns for name, address, phone, etc. I would like to create a listview that contains the names of all students added to the class. How do I do this? I have got it to the point that I can Toast out the objectIDs of all of my entries, but can't figure out how to extract and add just the names to the ListView. Here is a snippet of the code: //Set up the listview studentListView = (ListView)findViewById(R.id.listViewStudents); //Create and populate an ArrayList of objects from parse ParseQuery query = new ParseQuery("StudentInformation"); final ArrayList<Object> studentList = new ArrayList<Object>(); query.findInBackground(new FindCallback() { public void done(List<ParseObject> objects, ParseException e) { if (e == null) { Toast.makeText(getApplicationContext(), objects.toString(), Toast.LENGTH_LONG).show(); for(int i = 0;i < objects.size(); i++){ objects.get(i); studentList.add("name".toString()); } } else { Toast.makeText(getApplicationContext(), "Error", Toast.LENGTH_LONG).show(); } } }); //studentList.addAll(Arrays.asList(students)); listAdapter = new ArrayAdapter<Object>(this,android.R.layout.simple_list_item_1,studentList); studentListView.setAdapter(listAdapter); } I have left the toast in where I toatst out the objectIDs in the public void done.... method. Any help would be, as always, greatly appreciated. Should be mentioned (possibly), no errors are thrown, the listview just never gets populated after the toast disappears. Don't know if this will help anyone, but I took a bit from both posts below, and came up with this: //Set up the listview studentList = new ArrayList<String>(); //Create and populate an ArrayList of objects from parse listAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1); studentListView = (ListView)findViewById(R.id.listViewStudents); studentListView.setAdapter(listAdapter); final ParseQuery query = new ParseQuery("StudentInformation"); query.findInBackground(new FindCallback() { public void done(List<ParseObject> objects, ParseException e) { if (e == null) { //Toast.makeText(getApplicationContext(), objects.toString(), Toast.LENGTH_LONG).show(); for (int i = 0; i < objects.size(); i++) { Object object = objects.get(i); String name = ((ParseObject) object).getString("name").toString(); listAdapter.add(name); } } else { Toast.makeText(getApplicationContext(), "Error", Toast.LENGTH_LONG).show(); } } });

    Read the article

  • How to use jquery .animate() to mock 'text-align:right'

    - by mrwienerdog
    I am building a very simple jquery menu. On hover, I have a menu on the right easing to the left margin of my menu container. This is easy, as the text is left aligned within said container. However, I also have a menu on the left, and because the links (left justified) are of differing length, the best I can do is adjust the padding to ease the text a uniform amount between links. Therefor, long link text goes to the right edge of the container, buy short text only makes it about half way. In reading about this, I have learned that you can not modify the text align property as it is non numeric. Is there any other way to do this? I of course tried to go with: $('#selector').css('text-align':'right') but that made the text jump to the right instead of ease. Is there any way to ensure all links ease to the rightmost margin of the container?

    Read the article

1