hefuyicoder / ListenerMusicPlayer

A Grace Material Design Music Player
2.4k stars 574 forks source link

App-crash happens if user refused permssion. #22

Closed XinyueZ closed 7 years ago

XinyueZ commented 7 years ago

The app will crash when the user refuses permission at begin of application. I have sent a PR that fixed this crash, however, it is just a null-ptr-check not the problem source.

The problem head is focus-switch between different window if the permission-dialog shows. You should check onWindowFocusChanged and checkPermissionAndThenLoad in MainActivity .

hefuyicoder commented 7 years ago

Thanks your PR, I debug just now and haven't good idea without using null-ptr-check either