Anyone has a working code using the latest APIs to retrieve images and display them using an Array List and RecyclerView. I am able to upload the images and can retrieve one at a time but not all in an array and then display them using the Recycler view.
Here is the code. The class is called ImageUpload and inside there is the image with its description and Username. How can put ImageFile+Description+Username in Array called allPostsList.
ParseQuery<ParseObject> query = new ParseQuery("ImageUpload");
//Sort query by Ascending order as per created date
query.orderByAscending("createdAt");
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> objects, ParseException e) {
if(objects.size() >0 && e == null){
for(ParseObject object: objects){
ParseFile file = (ParseFile) object.get("ImageFile");
file.getDataInBackground(new GetDataCallback() {
@Override
public void done(byte[] data, ParseException e) {
if(e == null && data != null){
Bitmap bitmap = BitmapFactory.decodeByteArray(data,0,data.length);
//Post post = new Post();
//Post post = objects.get(bmpList, allPostsList);
//ImageView imageView = new ImageView(getContext());
//ArrayList<Bitmap> bitmapArray = new ArrayList<Bitmap>();
//postList.add(bitmap);
//bitmapArray.add(bitmap);
//imageView.setImageBitmap(bitmap);
//String currentUser = ParseUser.getCurrentUser().getUsername();
//Post spost = new Post(currentUser);
bmpList.add(bitmap);
//allPostsList.add(objects);
}