Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDavid Cahalan
5,462 Pointscant add pictures from gallery in meme maker app.
I followed through the whole course and the app seems to be running fine but when i try to add a picture in the app through the gallery the picture is never displayed in the images tab. I'm not sure what I am missing?
David Cahalan
5,462 PointsI was just wondering if it works for anyone else.
Ratul Sarna
Courses Plus Student 11,618 PointsHi, were you able to solve this?
David Cahalan
5,462 PointsNope. I moved on.
1 Answer
Rebecca MArtin
9,203 PointsHi,
I just solved this. You need to override the "onActivityResult" method in the ImageGridFragment as well, since its currently only in the activity fragment but there's no interface talking back tot he mainActivity so it just gets lost. Easiest solution is to generate the OnActivityResult override method using your IDE (If you copy paste it produces warnings) and then copy the body of that method from MainActivity to the ImageGridFragment. The issue you'll then run into is that you need to notify the GridAdapter that the data set has been changed. At the end of the all the code inside the result_ok if statement, put mGridAdapter.notifyDataSetChanged();
Mikael Enarsson
7,056 PointsMikael Enarsson
7,056 PointsI'm sorry to say it like this, but I'm a bit drunk, and a bit of code would be helpful.