vijai1996 / screenrecorder

NOTICE: This repository has moved to gitlab
https://gitlab.com/vijai/screenrecorder
GNU Affero General Public License v3.0
123 stars 49 forks source link

crash on almost samsung devices #37

Closed pourya0111 closed 6 years ago

pourya0111 commented 6 years ago

first attemp to open app cause crash and never be load into app

vijai1996 commented 6 years ago

Hello, please provide log to know the exact cause of the crash. Use adb logcat SCREENRECORDER_LOG:E *:S to get the log of the app alone.

webhat commented 6 years ago

It's possibility this issue: https://gitlab.com/fdroid/fdroiddata/issues/979

pourya0111 commented 6 years ago

my bad that was a issue from my side not the app sorry it fixed

pourya0111 commented 6 years ago

now i have a question and hope you can help me with i changed some lines of your code to start it in foreground and created a notification for it with pendingintent its working perfectly however its crashing after one record complete with error nullpointer

                                                                    Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.hardware.display.VirtualDisplay android.media.projection.MediaProjection.createVirtualDisplay(java.lang.String, int, int, int, int, android.view.Surface, android.hardware.display.VirtualDisplay$Callback, android.os.Handler)' on a null object reference

im recording when stop and try to record again it gives this error and crash any idea how to fix it?

vijai1996 commented 6 years ago

If you mean to say you try to record again after stopping the previous recording successfully, the log says you have not initialized the virtualDisplay after destroying the previous one (its destroyed as soon as you stop the recording. Check destroyMediaProjection() to see how the VirtualDisplay is released.

To fix, you will have to start right from obtaining permission for screencapturing, creating MediaProjection instance etc. I'm not sure what you want to achieve or what you are doing so. I only speak of my assumption.

pourya0111 commented 6 years ago

i've done it some way tricky all i wanted was to start,stop even when app is completley close after 3 hardwork days finally it,s here

vijai1996 commented 6 years ago

That's nice to hear. Closing the issue now.