Skip to content

Conversation

@dynamitechetan
Copy link
Member

Replaced Camera2 activity with a fragment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The app crashing on this line.
Here is the log:

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference
                                                                     at android.support.v4.content.ContextCompat.checkSelfPermission(ContextCompat.java:453)
                                                                     at vn.mbm.phimp.me.Camera2$2.onLocationChanged(Camera2.java:171)
                                                                     at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:281)
                                                                     at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:210)
                                                                     at android.location.LocationManager$ListenerTransport$1.handleMessage(LocationManager.java:226)
                                                                     at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                     at android.os.Looper.loop(Looper.java:135)
                                                                     at android.app.ActivityThread.main(ActivityThread.java:5268)
                                                                     at java.lang.reflect.Method.invoke(Native Method)
                                                                     at java.lang.reflect.Method.invoke(Method.java:372)
                                                                     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:902)
                                                                     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:697)
                                                                 
                                                                 
                                                                 --------- beginning of main

This might be because of Context in checkSelfPermission. Look in to it and update code. 👍

@dynamitechetan
Copy link
Member Author

@pa1pal please check, I fixed the error.

@abishekvashok
Copy link
Member

Pls resolve the conflicts @dynamitechetan

@dynamitechetan
Copy link
Member Author

All conflicts fixed

@pa1pal
Copy link
Member

pa1pal commented Mar 3, 2017

@dynamitechetan adding Camera fragment is a good contribution and you did great job 👍 .
But the Runtime permissions are implemented the correct way. You can quickly learn and implemented the runtime permissions using this Guide.

@dynamitechetan
Copy link
Member Author

I included a small library to implement runtime permissions to reduce the code. Is it not working fine?

@abishekvashok
Copy link
Member

Can you pls see the failing tests and fix them

@dynamitechetan
Copy link
Member Author

Done.

@pa1pal
Copy link
Member

pa1pal commented Mar 3, 2017

@dynamitechetan 👍

@pa1pal pa1pal merged commit e840be4 into fossasia:development Mar 3, 2017
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

Successfully merging this pull request may close these issues.

3 participants