Skip to content

Commit 93021bb

Browse files
committed
Re-order checks on permission results
Each permission check may need to handle acceptance and rejection differently.
1 parent b04e815 commit 93021bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/protect/videotranscoder/activity/MainActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ private void getPermission()
203203
public void onRequestPermissionsResult(int requestCode,
204204
String permissions[], int[] grantResults)
205205
{
206-
if(grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED)
206+
if(requestCode == READ_WRITE_PERMISSION_REQUEST)
207207
{
208-
if(requestCode == READ_WRITE_PERMISSION_REQUEST)
208+
if(grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED)
209209
{
210210
uploadVideo();
211211
}

0 commit comments

Comments
 (0)