0

I have created a profile creation page where users fills out a variety of information that gets recorded into parse. In this activity page a list of information from parse will be retrieved like Age, Name, Headline, and picture of many users in list (excluding current user). I have, however, experienced issues in retrieving images. Below is the error I have received from logcat:

08-16 21:53:16.401: E/AndroidRuntime(1345): FATAL EXCEPTION: main
08-16 21:53:16.401: E/AndroidRuntime(1345): Process: com.dooba.beta, PID: 1345
08-16 21:53:16.401: E/AndroidRuntime(1345): java.lang.ClassCastException: com.parse.ParseFile cannot be cast to android.provider.MediaStore$Images
08-16 21:53:16.401: E/AndroidRuntime(1345):     at com.dooba.beta.Fragment1$1.done(Fragment1.java:105)
08-16 21:53:16.401: E/AndroidRuntime(1345):     at com.parse.FindCallback.internalDone(FindCallback.java:45)
08-16 21:53:16.401: E/AndroidRuntime(1345):     at com.parse.FindCallback.internalDone(FindCallback.java:1)
08-16 21:53:16.401: E/AndroidRuntime(1345):     at com.parse.Parse$6$1.run(Parse.java:888)
08-16 21:53:16.401: E/AndroidRuntime(1345):     at android.os.Handler.handleCallback(Handler.java:733)
08-16 21:53:16.401: E/AndroidRuntime(1345):     at android.os.Handler.dispatchMessage(Handler.java:95)
08-16 21:53:16.401: E/AndroidRuntime(1345):     at android.os.Looper.loop(Looper.java:136)
08-16 21:53:16.401: E/AndroidRuntime(1345):     at android.app.ActivityThread.main(ActivityThread.java:5017)
08-16 21:53:16.401: E/AndroidRuntime(1345):     at java.lang.reflect.Method.invokeNative(Native Method)
08-16 21:53:16.401: E/AndroidRuntime(1345):     at java.lang.reflect.Method.invoke(Method.java:515)
08-16 21:53:16.401: E/AndroidRuntime(1345):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
08-16 21:53:16.401: E/AndroidRuntime(1345):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
08-16 21:53:16.401: E/AndroidRuntime(1345):     at dalvik.system.NativeStart.main(Native Method)

Below is the activity code:

public class Fragment1 extends Fragment {

    private String currentUserId;
    private ArrayAdapter<String> namesArrayAdapter;
    private ArrayList<String> names;
    private ArrayList<Images> alProfilePicture;
    private ListView usersListView;
    private Button logoutButton;
    String userGender = ParseUser.getCurrentUser().getString("Gender");
    String activityName = ParseUser.getCurrentUser().getString("ActivityName");
    Number maxDistance = ParseUser.getCurrentUser().getNumber("Maximum_Distance");
    String userLookingGender = ParseUser.getCurrentUser().getString("Looking_Gender");
    Number minimumAge = ParseUser.getCurrentUser().getNumber("Minimum_Age");
    Number maximumAge = ParseUser.getCurrentUser().getNumber("Maximum_Age");
    Number userage = ParseUser.getCurrentUser().getNumber("Age");

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        setConversationsList();

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment1_layout, container, false);


        return view;
    }

private void setConversationsList() {
    currentUserId = ParseUser.getCurrentUser().getObjectId();
    names = new ArrayList<String>();
    alProfilePicture = new ArrayList<Images>(); 

    // String userActivitySelectionName = null;

    ParseQuery<ParseUser> query = ParseUser.getQuery();

    //  query.whereEqualTo("ActivityName",userActivitySelectionName);

    query.whereNotEqualTo("objectId", ParseUser.getCurrentUser().getObjectId());
    // users with Gender = currentUser.Looking_Gender
    query.whereEqualTo("Gender", userLookingGender);
    // users with Looking_Gender = currentUser.Gender
    query.whereEqualTo("Looking_Gender", userGender);
    query.setLimit(1);
    query.whereEqualTo("ActivityName", activityName);
    //query.whereGreaterThanOrEqualTo("Age", minimumAge);
    //query.whereLessThanOrEqualTo("Age", maximumAge);
    query.orderByDescending("Name");




    query.findInBackground(new FindCallback<ParseUser>() {

        public void done(List<ParseUser> userList, ParseException e) {
            if (e == null) {
                for (int i=0; i<userList.size(); i++) {
                    names.add(userList.get(i).get("Name").toString());
                    names.add(userList.get(i).get("Headline").toString());
                    alProfilePicture.add((Images) userList.get(i).get("ProfilePicture"));
                    names.add(userList.get(i).get("Age").toString());
                    names.add(userList.get(i).get("ActivityName").toString());








                    //       names.add(userList.get(i).getParseObject("ProfilePicture").;


                }




                usersListView = (ListView)getActivity().findViewById(R.id.userlistview);
                namesArrayAdapter =
                        new ArrayAdapter<String>(getActivity().getApplicationContext(),
                                R.layout.user_list_item, names);
                usersListView.setAdapter(namesArrayAdapter);

                usersListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                    @Override
                    public void onItemClick(AdapterView<?> a, View v, int i, long l) {
                        openConversation(names, i);
                    }
                });

            } else {
                Toast.makeText(getActivity().getApplicationContext(),
                        "Error loading user list",
                        Toast.LENGTH_LONG).show();
            }
        }
    });
}

public void openConversation(ArrayList<String> names, int pos) {
    ParseQuery<ParseUser> query = ParseUser.getQuery();
    query.whereEqualTo("Name", names.get(pos));
    query.findInBackground(new FindCallback<ParseUser>() {
        public void done(List<ParseUser> user, ParseException e) {
            if (e == null) {
                Intent intent = new Intent(getActivity().getApplicationContext(), MessagingActivity.class);
                intent.putExtra("RECIPIENT_ID", user.get(0).getObjectId());
                startActivity(intent);
            } else {
                Toast.makeText(getActivity().getApplicationContext(),
                        "Error finding that user",
                        Toast.LENGTH_SHORT).show();
            }
        }
    });
}
}

In particular, I think the error derives from the following line:

            alProfilePicture.add((Images) userList.get(i).get("ProfilePicture"));

Thanks in advance, and all the best. Update

issues encounter

   ParseQuery<ParseObject> query = ParseQuery.getQuery("User");
                    query.getFirstInBackground(new GetCallback<ParseObject>() {
                      public void done(ParseObject object, ParseException e) {
                        if (object != null) {

                            ParseFile file = (ParseFile)object.get("Profile_Picture");
                            file.getDataInBackground(new GetDataCallback() {


                            public void done(byte[] data, ParseException e) {
                                if (e == null) {

                                    bitmap=BitmapFactory.decodeByteArray(data, 0, data.length);
                                    //use this bitmap as you want

                                } else {
                                  // something went wrong
                                }
                              }
                            });

                        } else {
                       //     Toast.makeText(getApplicationContext(), "Exception", Toast.LENGTH_SHORT) .show();

                        }
                      }
                    });

complete activity code

public class Fragment1 extends Fragment {

    private String currentUserId;
    private ArrayAdapter<String> namesArrayAdapter;
    private ArrayList<String> names;
    private ArrayList<Images> alProfilePicture;
    private ListView usersListView;
    private Button logoutButton;
    String userGender = ParseUser.getCurrentUser().getString("Gender");
    String activityName = ParseUser.getCurrentUser().getString("ActivityName");
    Number maxDistance = ParseUser.getCurrentUser().getNumber("Maximum_Distance");
    String userLookingGender = ParseUser.getCurrentUser().getString("Looking_Gender");
    Number minimumAge = ParseUser.getCurrentUser().getNumber("Minimum_Age");
    Number maximumAge = ParseUser.getCurrentUser().getNumber("Maximum_Age");
    Number userage = ParseUser.getCurrentUser().getNumber("Age");

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        setConversationsList();

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment1_layout, container, false);


        return view;
    }

private void setConversationsList() {
    currentUserId = ParseUser.getCurrentUser().getObjectId();
    names = new ArrayList<String>();
    alProfilePicture = new ArrayList<Images>(); 

    // String userActivitySelectionName = null;

    ParseQuery<ParseUser> query = ParseUser.getQuery();

    //  query.whereEqualTo("ActivityName",userActivitySelectionName);

    query.whereNotEqualTo("objectId", ParseUser.getCurrentUser().getObjectId());
    // users with Gender = currentUser.Looking_Gender
    query.whereEqualTo("Gender", userLookingGender);
    // users with Looking_Gender = currentUser.Gender
    query.whereEqualTo("Looking_Gender", userGender);
    query.setLimit(1);
    query.whereEqualTo("ActivityName", activityName);
    //query.whereGreaterThanOrEqualTo("Age", minimumAge);
    //query.whereLessThanOrEqualTo("Age", maximumAge);
    query.orderByDescending("Name");




    query.findInBackground(new FindCallback<ParseUser>() {

        public void done(List<ParseUser> userList, ParseException e) {
            if (e == null) {
                for (int i=0; i<userList.size(); i++) {
                    names.add(userList.get(i).get("Name").toString());
                    names.add(userList.get(i).get("Headline").toString());
                    names.add(userList.get(i).get("Age").toString());
                    names.add(userList.get(i).get("ActivityName").toString());

                    ParseQuery<ParseObject> query = ParseQuery.getQuery("User");
                    query.getFirstInBackground(new GetCallback<ParseObject>() {
                      public void done(ParseObject object, ParseException e) {
                        if (object != null) {

                            ParseFile file = (ParseFile)object.get("Profile_Picture");
                            file.getDataInBackground(new GetDataCallback() {


                            public void done(byte[] data, ParseException e) {
                                if (e == null) {

                                    Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
                                    //use this bitmap as you want

                                } else {
                                  // something went wrong
                                }
                              }
                            });

                        } else {
                          //  Toast.makeText(getApplicationContext(), "Exception", Toast.LENGTH_SHORT) .show();

                        }
                      }
                    });





                    //       names.add(userList.get(i).getParseObject("ProfilePicture").;


                }




                usersListView = (ListView)getActivity().findViewById(R.id.userlistview);
                namesArrayAdapter =
                        new ArrayAdapter<String>(getActivity().getApplicationContext(),
                                R.layout.user_list_item, names);
                usersListView.setAdapter(namesArrayAdapter);

                usersListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                    @Override
                    public void onItemClick(AdapterView<?> a, View v, int i, long l) {
                        openConversation(names, i);
                    }
                });

            } else {
                Toast.makeText(getActivity().getApplicationContext(),
                        "Error loading user list",
                        Toast.LENGTH_LONG).show();
            }
        }
    });
}

public void openConversation(ArrayList<String> names, int pos) {
    ParseQuery<ParseUser> query = ParseUser.getQuery();
    query.whereEqualTo("Name", names.get(pos));
    query.findInBackground(new FindCallback<ParseUser>() {
        public void done(List<ParseUser> user, ParseException e) {
            if (e == null) {
                Intent intent = new Intent(getActivity().getApplicationContext(), MessagingActivity.class);
                intent.putExtra("RECIPIENT_ID", user.get(0).getObjectId());
                startActivity(intent);
            } else {
                Toast.makeText(getActivity().getApplicationContext(),
                        "Error finding that user",
                        Toast.LENGTH_SHORT).show();
            }
        }
    });
}
}

Update 2 ImageView added in layout, and refereed to in code, but is not being displayed. Below is the activity class public class Fragment1 extends Fragment {

    private String currentUserId;
    private ArrayAdapter<String> namesArrayAdapter;
    private ArrayList<String> names;
    private ArrayList<Images> alProfilePicture;
    private ListView usersListView;
    private Button logoutButton;
    String userGender = ParseUser.getCurrentUser().getString("Gender");
    String activityName = ParseUser.getCurrentUser().getString("ActivityName");
    Number maxDistance = ParseUser.getCurrentUser().getNumber("Maximum_Distance");
    String userLookingGender = ParseUser.getCurrentUser().getString("Looking_Gender");
    Number minimumAge = ParseUser.getCurrentUser().getNumber("Minimum_Age");
    Number maximumAge = ParseUser.getCurrentUser().getNumber("Maximum_Age");
    Number userage = ParseUser.getCurrentUser().getNumber("Age");

    @Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);

        setConversationsList();

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment1_layout, container, false);


        return view;
    }

private void setConversationsList() {
    currentUserId = ParseUser.getCurrentUser().getObjectId();
    names = new ArrayList<String>();
    alProfilePicture = new ArrayList<Images>(); 

    // String userActivitySelectionName = null;

    ParseQuery<ParseUser> query = ParseUser.getQuery();

    //  query.whereEqualTo("ActivityName",userActivitySelectionName);

    query.whereNotEqualTo("objectId", ParseUser.getCurrentUser().getObjectId());
    // users with Gender = currentUser.Looking_Gender
    query.whereEqualTo("Gender", userLookingGender);
    // users with Looking_Gender = currentUser.Gender
    query.whereEqualTo("Looking_Gender", userGender);
    query.setLimit(1);
    query.whereEqualTo("ActivityName", activityName);
    //query.whereGreaterThanOrEqualTo("Age", minimumAge);
    //query.whereLessThanOrEqualTo("Age", maximumAge);
    query.orderByDescending("Name");




    query.findInBackground(new FindCallback<ParseUser>() {
        public void done(ParseObject object,ParseException e) {
        ParseQuery<ParseObject> query = ParseQuery.getQuery("User");
        query.getFirstInBackground(new GetCallback<ParseObject>() {
          public void done(ParseObject object, ParseException e) {
            if (object != null) {

                ParseFile file = (ParseFile)object.get("Profile_Picture");
                file.getDataInBackground(new GetDataCallback() {


                public void done(byte[] data, ParseException e) {
                    if (e == null) {

                        Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
                        //use this bitmap as you want
                        ImageView profileimage =(ImageView) getActivity().findViewById(R.id.profilePictureresult);
                        // Set the Bitmap into the
                        // ImageView
                        profileimage.setImageBitmap(bitmap);

                    } else {
                      // something went wrong
                    }
                  }
                });

            } else {
              //  Toast.makeText(getApplicationContext(), "Exception", Toast.LENGTH_SHORT) .show();

            }
          }
        });
        }
        public void done(List<ParseUser> userList, ParseException e) {
            if (e == null) {
                for (int i=0; i<userList.size(); i++) {
                    names.add(userList.get(i).get("Name").toString());








                    //       names.add(userList.get(i).getParseObject("ProfilePicture").;


                }




                usersListView = (ListView)getActivity().findViewById(R.id.userlistname);
                namesArrayAdapter =
                        new ArrayAdapter<String>(getActivity().getApplicationContext(),
                                R.layout.user_list_item, names);
                usersListView.setAdapter(namesArrayAdapter);

                usersListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                    @Override
                    public void onItemClick(AdapterView<?> a, View v, int i, long l) {
                        openConversation(names, i);
                    }
                });

            } else {
                Toast.makeText(getActivity().getApplicationContext(),
                        "Error loading user list",
                        Toast.LENGTH_LONG).show();
            }
        }
    });
}

public void openConversation(ArrayList<String> names, int pos) {
    ParseQuery<ParseUser> query = ParseUser.getQuery();
    query.whereEqualTo("Name", names.get(pos));
    query.findInBackground(new FindCallback<ParseUser>() {
        public void done(List<ParseUser> user, ParseException e) {
            if (e == null) {
                Intent intent = new Intent(getActivity().getApplicationContext(), MessagingActivity.class);
                intent.putExtra("RECIPIENT_ID", user.get(0).getObjectId());
                startActivity(intent);
            } else {
                Toast.makeText(getActivity().getApplicationContext(),
                        "Error finding that user",
                        Toast.LENGTH_SHORT).show();
            }
        }
    });
}
}

Below is the XML layout file

  <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="@drawable/bac_blue"
        android:orientation="vertical" >

        <ListView
            android:id="@+id/userlistname"
            android:layout_width="220dp"
            android:layout_centerHorizontal="true"
            android:layout_height="50dp"
            android:divider="@null"

            >

        </ListView>

        <ListView
            android:id="@+id/userlistheadline"
            android:layout_width="220dp"
            android:layout_below="@+id/userlistname"
            android:layout_centerHorizontal="true"
            android:layout_height="50dp"
            android:divider="@null"

            >

        </ListView>

         <ImageView
            android:id="@+id/profilePictureresult"
            android:layout_width="132dp"
            android:layout_height="120dp"
            android:layout_below="@+id/userlistheadline"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="7dp"
            android:layout_marginBottom="9dp"
            android:padding="3dp"
            android:scaleType="centerCrop"
            android:cropToPadding="true"
            android:background="@drawable/border_image"
            android:alpha="1" />

        <ListView
            android:id="@+id/userlistage"
            android:layout_width="220dp"
            android:layout_below="@+id/profilePictureresult"
            android:layout_centerHorizontal="true"
            android:layout_height="50dp"
            android:divider="@null"

            >

        </ListView>

         <ListView
            android:id="@+id/userlistactivityname"
            android:layout_width="220dp"
            android:layout_below="@+id/profilePictureresult"
            android:layout_centerHorizontal="true"
            android:layout_height="50dp"
            android:divider="@null"

            >

        </ListView>


        <Button
            android:id="@+id/button1"
            android:layout_below="@+id/userlistactivityname"
            android:layout_centerHorizontal="true"
            android:layout_width="100dp"
            android:layout_height="50dp"
            android:layout_marginTop="12dp"
            android:alpha="0.7"
            android:textColor="#000000"
            android:background="#ADD8E6"
            android:textSize="22sp"
            android:typeface="serif"
            android:text="Confirm" />

        <ImageView
            android:id="@+id/imageView2"
            android:layout_width="70dp"
            android:layout_height="50dp"
            android:layout_alignParentRight="true"
            android:layout_alignTop="@+id/imageView1"
            android:alpha="0.7"
            android:src="@drawable/left_right" />

        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="70dp"
            android:layout_height="50dp"
            android:layout_alignBottom="@+id/userlistview"
            android:layout_alignParentLeft="true"
            android:layout_marginBottom="119dp"
            android:alpha="0.7"
            android:src="@drawable/left_arrow2" />

    </RelativeLayout>

Update 3

    query.findInBackground(new FindCallback<ParseUser>() {
        public void done(ParseObject object,ParseException e) {
        ParseQuery<ParseObject> query = ParseQuery.getQuery("User");
        query.getFirstInBackground(new GetCallback<ParseObject>() {
          public void done(ParseObject object, ParseException e) {
            if (object != null) {

                ParseFile file = (ParseFile)object.get("ProfilePicture");
                file.getDataInBackground(new GetDataCallback() {


                public void done(byte[] data, ParseException e) {
                    if (e == null) {

                        Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
                        //use this bitmap as you want
                        ImageView profileimage =(ImageView) getView().findViewById(R.id.profilePictureResult);
                        // Set the Bitmap into the
                        // ImageView
                        profileimage.setImageBitmap(bitmap);
                        Log.e("works", e.getMessage());
                        e.printStackTrace();

                    } else {
                      // something went wrong
                        Log.e("Error", e.getMessage());
                        e.printStackTrace();
                    }
                  }
                });

            } else {
              //  Toast.makeText(getApplicationContext(), "Exception", Toast.LENGTH_SHORT) .show();
                Log.e("Error 2", e.getMessage());
                e.printStackTrace();

            }
          }
        });
        }
code_legend
  • 3,547
  • 15
  • 51
  • 95

2 Answers2

1

You can't simply take what comes from the parse get("ProfilePicture") and cast it to Images. It isn't of class Images, it is a ParseFile instead. You need to convert the data in the ParseFile into a Bitmap and use Bitmaps in your application instead.

This page shows how to convert a ParseFile into a byte array you con use to construct a bitmap in the background.

Nick Palmer
  • 2,589
  • 1
  • 25
  • 34
  • Thanks for your response and the clarification. I have followed your advice, but for some reason I am still experiencing issue displaying the image once it has been retrieved. I have updated my updated code under the update section of my initial post. Thanks – code_legend Aug 17 '14 at 13:25
  • 1
    Consider adding a log message in the callback to ensure that the bitmap is being constructed, and at least a log in the exception clause to make sure there is no exception. I expect that you are getting an exception there but you don't know it because you have nothing in the else clause handling it. Also check your layout in the HeirarchyViewer to ensure that the are you think the image is going into is being displayed on screen. – Nick Palmer Aug 17 '14 at 19:03
  • Thanks for your response and suggestion. I will log in the exception to try and investigate the issue, but I may have a hint. I was giving the following warning - The method done(ParseObject, ParseException) from the type new FindCallback(){} is never used locally for the below line public void done(ParseObject object,ParseException e) { – code_legend Aug 17 '14 at 19:14
  • 1
    Again, more logging would tell you that your done method is not being called correctly which then never triggers the fetch of the image data. In general sprinkling log statements around is a great way to debug issues since you can watch the execution in logcat and make sure you are hitting important points in your code. – Nick Palmer Aug 17 '14 at 19:27
  • Thanks and I agree. I added a few Log.e to try and verify where the issue is being derived from, but for some reason the log message is not being displayed. I have updated my code under update 3 – code_legend Aug 17 '14 at 20:06
  • I suspect your query has no results. Put a log statement at the top of the first done in your update and double check the query. – Nick Palmer Aug 17 '14 at 20:07
  • Thanks for your response. I have added a series of log statements and have concluded that it stops at public void done(ParseObject object,ParseException e) { and then it doesn't read the rest (i have log at nearly every line). I am not sure if this code is wrongly placed, because that line is highlighted in yellow and states The method done(ParseObject, ParseException) from the type new FindCallback(){} is never used locally – code_legend Aug 17 '14 at 22:23
1

you are right about where the problem is ...

The profilepic.add(images)... line needs some work. But i think you should do some reading on a couple of framework things and then return to your implementation of your lists and your arrayAdapter...

ViewHolder pattern and lists...

loading images like "picasso" or "univ. ImageLoader" or "aQuery". you need to know what they do and why they are essential.

You dont want to manage a list of Bitmaps or a list of images. There are optimized image loader frameworks that you should eval and choose one of and learn it and use it.

You will have memory problems sooner or later doing anything on your own with list of images/bitmaps.

Remember that any call to a Parse class that wraps a pointer to an instance of a parse uploaded photo will return strings that are sort of logical ref to a Uri . This Uri is an https protocol network object with a MIME type of "image/*". When you do the GET on the parse class with the pointer, you get a JSON wrapper that you do something like this to get the Urls...

    "media4":{"__type":"File","name":"..-picf1","url":"http://files.parse.com/...c8652d6-picf1"}

    JSONObject jsonObj = new VideoProvider().parseUrl(url, ctx); // get the parse wrapper cls                
    // aloop to get list entries from parse response will get 'media4'    
    String imageurl = media4.getString("url"); 

where "media4" is the JSON object in the parse response getting the Class wrapping the images. Parse is built to collaborate with any imageLoading framework because you simply supply a string ( Url ) or a Uri to framework which does the rest. ( gets a bitmap from Uri and loads it to imageView within context of the ArrayAdapters call to "getView()".

Returning to viewholders and image loaders...

The constructor for the Viewholder simply loads the Uri into a field.

Then in the "convertView" you pass 2 fields ( they are really a common interface with any ImageLoader framework )...

  1. ref to the ImageView - layout Obj. for your profile picture

  2. ref to the Uri (or string to build a Uri)

The loaderFramework does all caching ( file & memory ). The loaderFramework does all async network gets when you dont have a local ref from which to get a bitMap. The loaderFramework may also be able to manage bitmap sizes, port v landscape aspects etc.

Community
  • 1
  • 1
Robert Rowntree
  • 6,230
  • 2
  • 24
  • 43
  • Thank your detailed response and information. I have conducted more research and hence have updated my code. It doesn't show any error, but when I run the application, no image is displayed. I have updated my code under the update section of my initial post. If you could kindly look into that would be incredibly helpful. – code_legend Aug 17 '14 at 13:24
  • 1
    i'd start debugging around the statement where you do "BitmapFactory.decode()". DBG - are you making the connection to get the file to stream into the 'decode'. are u getting bitmap? are u loading bitmap to a layout that includes ImageView? – Robert Rowntree Aug 17 '14 at 13:46
  • Thanks for your suggestion and support. I added many of the things that you have suggested, but for some reason the image is not being displayed in the imageView. I have updated my initial code under update 2 of my post. Thanks – code_legend Aug 17 '14 at 18:19
  • https://github.com/mimoccc/Android-Parse.com-ListView-Images-and-Texts-Tutorial this probably works . if u r stuck install/debug something that works and apply it to your project – Robert Rowntree Aug 17 '14 at 19:31
  • Thanks for your response. I notice that they are using JSON to populate the image though through parse. The path seems to be quite different. To me this should be working as I am refering to the correct class, and the correct column and the correct imageview, but its really this warning thats fuzzing me - The method done(ParseObject, ParseException) from the type new FindCallback(){} is never used locally for the below line public void done(ParseObject object,ParseException e) { – code_legend Aug 17 '14 at 20:11