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

Media is gif is null #381

Closed
harshmittal2810 opened this issue Dec 16, 2016 · 17 comments
Closed

Media is gif is null #381

harshmittal2810 opened this issue Dec 16, 2016 · 17 comments

Comments

@harshmittal2810
Copy link

Sometimes when i click on any folder and in that folder there is only 4 media.
When i click on folder it crashed and give me error on Media.java(107) : Media.isGif() on null object reference.
I have debug i got the reason for this, there is mimetype is null, help me to solve out these issues.

@dnldsht
Copy link
Member

dnldsht commented Dec 16, 2016

@mittalharsh2810 have you tried to build the latest version on dev branch?

@harshmittal2810
Copy link
Author

Dev version is not showing any file in my device

@dnldsht
Copy link
Member

dnldsht commented Dec 16, 2016 via email

@harshmittal2810
Copy link
Author

Why it is so, there is any other option to make it defaults

@harshmittal2810
Copy link
Author

I want to join your app development also

@dnldsht
Copy link
Member

dnldsht commented Dec 16, 2016 via email

@harshmittal2810
Copy link
Author

when will be the next release

@dnldsht
Copy link
Member

dnldsht commented Dec 16, 2016 via email

@harshmittal2810
Copy link
Author

When i am Adding White List some of folder will automatically unchecked.
I tried two or more time checked them but after returning it was excluded.

@dnldsht
Copy link
Member

dnldsht commented Dec 16, 2016 via email

@xtj-9182
Copy link

xtj-9182 commented Dec 16, 2016

Dev version is not showing any file in my device

I had this too and I just assumed that the dev build was broken hehe
didn't know about the white listing.

@dnldsht
anyway the current latest dev build (5035591) seems to work on my side. I don't have the behavior that is described by @mittalharsh2810

I have just one question what is the "looked for media" notification doing ? It seems to be there at all times and if you swipe it away it will just pop up again...

also somehow LookForMediaJob seems to make it harder to hibernate LeafPic, using greenify it takes 3 to 4 times until LeafPic will play nice and let itself be hibernated.

edit: also I just noticed there is no gradlew.bat for windows in the dev branch but it is there in the master branch. I think someone deleted it by accident

@dnldsht
Copy link
Member

dnldsht commented Dec 16, 2016

@xtj-9182 I'm finding out how to solve the issue that some folders aren't scanned by the MediaStore on some devices.
Since I'dont know so much about backgroud services, I'm testing some of them, in the latest build there are a service that the Andoid system chose when to execute it (it should run when your device is doing nothing) the notification just help me to kwno when it start (in the next relase it will be disabled by default).

May I know how frequently the notification show up? I will also take a look at greenify

I just noticed there is no gradlew.bat for windows

It's my fault, I thought it was useless, I use Linux to develop this, I'm gonna restore it

@harshmittal2810
Copy link
Author

harshmittal2810 commented Feb 12, 2017

Hello, I am getting the same error in latest branch dev.
And the error is in some folder like this:
02-12 16:35:42.261 31293-31293/org.horaapps.leafpic.debug E/AndroidRuntime: FATAL EXCEPTION: main Process: org.horaapps.leafpic.debug, PID: 31293 java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.endsWith(java.lang.String)' on a null object reference at org.horaapps.leafpic.model.Media.isGif(Media.java:102) at org.horaapps.leafpic.adapters.MediaAdapter.onBindViewHolder(MediaAdapter.java:66) at org.horaapps.leafpic.adapters.MediaAdapter.onBindViewHolder(MediaAdapter.java:31) at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6279) at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6312) at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5258) at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5521) at android.support.v7.widget.GapWorker.prefetchPositionWithDeadline(GapWorker.java:270) at android.support.v7.widget.GapWorker.flushTaskWithDeadline(GapWorker.java:324) at android.support.v7.widget.GapWorker.flushTasksWithDeadline(GapWorker.java:337) at android.support.v7.widget.GapWorker.prefetch(GapWorker.java:344) at android.support.v7.widget.GapWorker.run(GapWorker.java:370) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5740) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766)

@lalitsonawane
Copy link

Try putting try catch where you are getting error.

@harshmittal2810
Copy link
Author

thanks but it is not satisfied code because if i put try catch,
media will not be shown to than and further also.

dnldsht added a commit that referenced this issue Feb 13, 2017
@dnldsht
Copy link
Member

dnldsht commented Feb 13, 2017

check out last commit it should fix this issue

@harshmittal2810
Copy link
Author

I am still getting that error in Media Adapter
when I debug the app there is some image which does not have mime type or missing mime type.
there must be some handle for that ?

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