Guest User

Untitled

a guest
Jul 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. try{
  2. System.gc();
  3. String fileName = System.currentTimeMillis()+".jpg";
  4. String mPathImage = Environment.getExternalStorageDirectory()+ "/" + fileName;
  5. File file = new File(mPathImage);
  6. Uri outputFileUri = Uri.fromFile( file );
  7. Intent mIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  8. mIntent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri );
  9. startActivityForResult(mIntent, 1);
  10. mValue=1;
  11.  
  12. try {
  13. System.gc();
  14. Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
  15. startActivityForResult(intent, 1);
  16. mValue=2;
  17. }catch(Exception e){}
  18.  
  19. try{
  20. System.gc();
  21. Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
  22. intent.setType("*/*");
  23. startActivityForResult(intent,1);
  24. mValue=3;
  25. }catch(Exception e){}
  26. }
Add Comment
Please, Sign In to add comment