Android Concept | Techbirds

Code to fire Intent to Get the image from Camera and Phone Gallery in Android :
// from camera
camera_btn.setOnClickListener(new OnClickListener() {

@Override public void onClick(View v) {

// TODO Auto-generated method stub

Intent intent = new Intent(
android.provider.MediaStore.ACTION_IMAGE_CAPTURE);

startActivityForResult(intent, REQUEST_TAKE_PHOTO);

}
});

// from library
library_btn.setOnClickListener(new OnClickListener() {

@Override public void onClick(View v) { // TODO Auto-generated method stub Intent intent = new Intent(); intent.setType(“image/*”); intent.setAction(Intent.ACTION_GET_CONTENT); intent.addCategory(Intent.CATEGORY_OPENABLE);

startActivityForResult(intent, SELECT_PICTURE);

} });

}

496 total views, 1 views today

Share this Onfacebook-4459460twitter-1696821linkedin-9555763google-4933426