daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 37 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var cameraIntent: Intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE)
  2. startActivityForResult(cameraIntent, CAMERA_INTENT_CODE)
  3.    
  4. override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
  5. when (requestCode) {
  6.     CAMERA_INTENT_CODE -> {
  7.         if (resultCode == Activity.RESULT_OK) {
  8.             fileUri = data!!.data
  9.             openEditor(fileUri)
  10.         } else {
  11.             Toast.makeText(mContext, "Error occured! Try again!", Toast.LENGTH_SHORT).show()
  12.         }
  13.     }
  14. }
  15.    
  16. <uses-permission android:name="android.permission.CAMERA" />
  17. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top