0

i have a question trouble me very long,in my app i using a built-in camera, i want to take a pic.if i am only a common activity i can use:

 Intent intent = new 
 Intent("android.media.action.IMAGE_CAPTURE");

 startActivityForResult(intent, 0);

// ...

@Override
public void onActivityResult(int requestCode, int   resultCode, Intent data) {

if (resultCode == Activity.RESULT_OK && requestCode == 0) {
String result = data.toURI();

 }
}

because my app have Nested many layer,my takepic activity at one tab of tabactivity of tabactivity.so onActivityResult cannot get any value. so i want to use broadcast to get the pic but in the built-in camera app,i cannot write code to send broadcast. so my question how to get the pic not use onActivityResult methods.thank you

Edit:solved broadcast receiver won't receive camera event

Community
  • 1
  • 1
pengwang
  • 19,536
  • 34
  • 119
  • 168

1 Answers1

1

You might want to consider showing the camera inside a view in your app and bypassing the standard camera app entirely. If you're curious about doing this, here are some good resources to get you started:

spatulamania
  • 6,613
  • 2
  • 30
  • 26
  • thank you,but my app have custom a camera app,i give people to choice one is my camera app,one is built-in.if can i receive broadcast about the change of pic save location ? – pengwang Oct 26 '11 at 03:26
  • 1
    @pengwang I see. Have you seen this question? http://stackoverflow.com/questions/4571461/broadcast-receiver-wont-receive-camera-event – spatulamania Oct 26 '11 at 03:28