Click here to Skip to main content
15,885,074 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Sir,

I have drawn customized view in activity by using canvas in another class which extends view.In this customized view i have an image which is used to navigate into android camera view.

How to call android camera intent from view class.

Thanks,
Jacob
Posted

1 solution

Something along the lines of

Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);


and of course

@override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if(requestCode == CAMERA_PIC_REQUEST && resultCode == Activity.RESULT_OK) {
            // do what ever you want 
            // like create a bitmap from data
            // or what the code needs
        } 
     // failure no picture taken
    }


Hope this helps

/Darren
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900