Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
madeye committed Sep 28, 2016
1 parent 5d7e883 commit 528fea1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/scala/com/github/shadowsocks/ScannerActivity.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.github.shadowsocks

import android.Manifest
import android.app.Activity
import android.content.Intent
import android.content.pm.PackageManager
Expand Down Expand Up @@ -48,13 +47,13 @@ class ScannerActivity extends AppCompatActivity with ZXingScannerView.ResultHand
override def onResume() {
super.onResume()
val permissionCheck = ContextCompat.checkSelfPermission(this,
Manifest.permission.CAMERA)
android.Manifest.permission.CAMERA)
if (permissionCheck == PackageManager.PERMISSION_GRANTED) {
scannerView.setResultHandler(this) // Register ourselves as a handler for scan results.
scannerView.startCamera() // Start camera on resume
} else {
ActivityCompat.requestPermissions(this,
Array(Manifest.permission.CAMERA), MY_PERMISSIONS_REQUEST_CAMERA)
Array(android.Manifest.permission.CAMERA), MY_PERMISSIONS_REQUEST_CAMERA)
}
}

Expand Down

0 comments on commit 528fea1

Please sign in to comment.