Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullpointerException when starting activity #19

Closed
olavbg opened this issue Nov 2, 2016 · 5 comments
Closed

NullpointerException when starting activity #19

olavbg opened this issue Nov 2, 2016 · 5 comments

Comments

@olavbg
Copy link

olavbg commented Nov 2, 2016

I have followed the description in the Readme, declaring the activity in the manifest, putting the required extras (with ArrayList og string urls) and implementing ImageGalleryAdapter.ImageThumbnailLoader and FullScreenImageGalleryAdapter.FullScreenImageLoader in my calling activity.

But I get a NPE from com.etiennelawlor.imagegallery.library.activities.ImageGalleryActivity.loadImageThumbnail(ImageGalleryActivity.java:101) where the imageThumbnailLoader is NULL.

Am I doing something wrong?

StackTrace: https://gist.github.com/olavbg/e19fdc38700d83b3d90e9e1ddf7340d6

  • Olav Blaaflat
@manijak
Copy link

manijak commented Nov 4, 2016

I'm getting the same exception. How do we properly set the loaders, and why is this mandatory all of a sudden?

@lawloretienne
Copy link
Owner

Take a look at MainActivity

https://github.com/lawloretienne/ImageGallery/blob/3e1ed255012a99aa1a245c2aa384eeb216d22370/sample/src/main/java/com/etiennelawlor/imagegallery/activities/MainActivity.java

I am calling

ImageGalleryActivity.setImageThumbnailLoader(this);

and then I am implementing the ImageGalleryAdapter.ImageThumbnailLoader interface in MainActivity.

Do you have all of this setup?

@olavbg
Copy link
Author

olavbg commented Nov 8, 2016

After adding these lines it works again:

ImageGalleryActivity.setImageThumbnailLoader(this);
FullScreenImageGalleryActivity.setFullScreenImageLoader(this);

Should probably point these out in the readme as well?

Cheers!

@olavbg olavbg closed this as completed Nov 8, 2016
@lawloretienne
Copy link
Owner

in the README there is a section titled important note which calls attention to that.

@antonioreyna
Copy link

antonioreyna commented Apr 27, 2018

i had this same problem but just to mention that the readme jjust says

Important Note

You must now set up image loading by implementing these interfaces ImageGalleryAdapter.ImageThumbnailLoader and FullScreenImageGalleryAdapter.FullScreenImageLoader. See

never mention about the methods to set the this

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants