Android- taking a picture for temporary use with the camera intent

Lijap

I am taking a picture with the built-in camera intent, and my app just needs the image to create one bitmap. Is it possible to avoid the image saving to the gallery without creating my own custom camera? Here is my current code to take the picture.

public void open() {
    Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
    startActivityForResult(intent, 1);
}
static Bitmap bp;

public void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);
    bp = (Bitmap) data.getExtras().get("data");
    onNavigationDrawerItemSelected(currentPosition);

    }
Jorge Moreno

Nop, but you can delete it, try this code:

 private void DeletePicTaken(){
            final String[] imageColumns = { BaseColumns._ID, MediaColumns.DATA };
            final String imageOrderBy = BaseColumns._ID + " DESC";
            Cursor imageCursor = managedQuery(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, imageColumns, null, null, imageOrderBy);
            if(imageCursor.moveToFirst()){
                //int id = imageCursor.getInt(imageCursor.getColumnIndex(MediaStore.Images.Media._ID));
                String fullPath = imageCursor.getString(imageCursor.getColumnIndex(MediaColumns.DATA));
                //imageCursor.close();
                File file = new File(fullPath);
                file.delete();
            }


        } 

public void onActivityResult(int requestCode, int resultCode, Intent data) {
    // TODO Auto-generated method stub
    super.onActivityResult(requestCode, resultCode, data);
    bp = (Bitmap) data.getExtras().get("data");
    onNavigationDrawerItemSelected(currentPosition);
    DeletePicTaken();
    }

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to force user to use the "square" camera filter when taking a picture

From Dev

Change the text for buttons when taking picture via Camera using UIIMagePickerController

From Dev

Taking picture without SurfaceView or without Photo Intent Activity

From Dev

Camera is not saving after taking picture

From Dev

Fatal signal 11 and weird error messages when taking picture with camera in Android

From Dev

Can we bypass save and delete option in intent camera for taking image in android?

From Dev

Taking Picture via intent to internal (app) storage returns null for bitmap

From Dev

Android: take camera picture intent remove confirmation dialog

From Dev

Using android camera with an explicit intent

From Dev

Android taking picture with FileProvider

From Dev

Android camera and photo picker intent

From Dev

Take picture only with android camera intent in Kotlin, not video

From Dev

Rotating picture from android camera

From Dev

Taking picture with Android Camera Preview and saving in SQL database is crashing

From Dev

fileNotFoundException camera intent - Android

From Dev

android camera intent use another activity

From Dev

Sent camera picture via intent

From Dev

Android Tablet Take Picture Camera Intent Activity Restarts

From Dev

How to know Camera Is completed taking taking picture In ios

From Dev

Camera crashes after taking picture and hitting ok

From Dev

android: camera is not taking a picture

From Dev

Can we bypass save and delete option in intent camera for taking image in android?

From Dev

Taking Picture via intent to internal (app) storage returns null for bitmap

From Dev

Using android camera with an explicit intent

From Dev

Android - Ensuring that photo orientation is preserved when taking photos via Camera Intent?

From Dev

Perform a segue to a new viewController when clicking the "use photo" button after taking picture with camera iOS 10 (swift 3)

From Dev

Android: taking a picture without calling local Camera app

From Dev

Capture text from camera without taking picture

From Dev

Taking a picture with a camera intent and saving it to a file

Related Related

  1. 1

    How to force user to use the "square" camera filter when taking a picture

  2. 2

    Change the text for buttons when taking picture via Camera using UIIMagePickerController

  3. 3

    Taking picture without SurfaceView or without Photo Intent Activity

  4. 4

    Camera is not saving after taking picture

  5. 5

    Fatal signal 11 and weird error messages when taking picture with camera in Android

  6. 6

    Can we bypass save and delete option in intent camera for taking image in android?

  7. 7

    Taking Picture via intent to internal (app) storage returns null for bitmap

  8. 8

    Android: take camera picture intent remove confirmation dialog

  9. 9

    Using android camera with an explicit intent

  10. 10

    Android taking picture with FileProvider

  11. 11

    Android camera and photo picker intent

  12. 12

    Take picture only with android camera intent in Kotlin, not video

  13. 13

    Rotating picture from android camera

  14. 14

    Taking picture with Android Camera Preview and saving in SQL database is crashing

  15. 15

    fileNotFoundException camera intent - Android

  16. 16

    android camera intent use another activity

  17. 17

    Sent camera picture via intent

  18. 18

    Android Tablet Take Picture Camera Intent Activity Restarts

  19. 19

    How to know Camera Is completed taking taking picture In ios

  20. 20

    Camera crashes after taking picture and hitting ok

  21. 21

    android: camera is not taking a picture

  22. 22

    Can we bypass save and delete option in intent camera for taking image in android?

  23. 23

    Taking Picture via intent to internal (app) storage returns null for bitmap

  24. 24

    Using android camera with an explicit intent

  25. 25

    Android - Ensuring that photo orientation is preserved when taking photos via Camera Intent?

  26. 26

    Perform a segue to a new viewController when clicking the "use photo" button after taking picture with camera iOS 10 (swift 3)

  27. 27

    Android: taking a picture without calling local Camera app

  28. 28

    Capture text from camera without taking picture

  29. 29

    Taking a picture with a camera intent and saving it to a file

HotTag

Archive