Advertisement
Guest User

Untitled

a guest
May 28th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. query.whereEqualto("name", "jon")
  2. .orderByDescending("createdAt")
  3. //.orderByDescending("objectId")
  4. .findInBackground(new FindCallback<ParseObject>() {
  5. @Override
  6. public void done(List<ParseObject> list, ParseException e) {
  7.  
  8. if (e == null) {
  9. if (list.size() > 0) {
  10. for (final ParseObject object : list) {
  11. ParseFile file = (ParseFile) object.get("imageFile");
  12. file.getDataInBackground(new GetDataCallback() {
  13. @Override
  14. public void done(byte[] bytes, ParseException e) {
  15.  
  16. if (e == null) {
  17. Bitmap image = BitmapFactory.decodeByteArray(bytes, 0, bytes.length);
  18.  
  19. ImageView imageView = new ImageView(getApplicationContext());
  20. imageView.setImageBitmap(image);
  21. imageView.setLayoutParams(new ViewGroup.LayoutParams(
  22. ViewGroup.LayoutParams.MATCH_PARENT,
  23. ViewGroup.LayoutParams.WRAP_CONTENT
  24.  
  25. ));
  26.  
  27.  
  28. Log.i("info", "object Id " + object.get("objectId"));
  29. Log.i("info", "created At " + object.get("createdAt"));
  30.  
  31. }
  32. }
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement