Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5990957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:19:06+00:00 2026-05-22T23:19:06+00:00

I have a little problem with my camera intent. As I know, when camera

  • 0

I have a little problem with my camera intent. As I know, when camera orientation is changed, activity is restarted. Okej, I am using the code bellow.

    @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    app = (myApplication)getApplication(); 

    if(savedInstanceState ==null ) getFullImage(null);
    else{
        String somevalue = savedInstanceState.getString("uri");
        getFullImage(somevalue);
        }
}

private void getFullImage(String testValue)
{   if(testValue == null){
    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    file = new File(Environment.getExternalStorageDirectory(), UUID.randomUUID()+ ".jpg");
    outputFile = Uri.fromFile(file);
    intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFile);
    startActivityForResult(intent, TAKE_PICTURE);

}else 
{   
    outputFile = null;
    Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
    file = new File(testValue);
    outputFile = Uri.fromFile(file);
    intent.putExtra(MediaStore.EXTRA_OUTPUT, testValue);
    startActivityForResult(intent, TAKE_PICTURE);
    finishFromChild(getParent());
}

}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if(resultCode == RESULT_CANCELED) {
        Log.i(TAG, "Back Button"); 
        finishFromChild(this);
    } 
    else
     if(requestCode == TAKE_PICTURE && resultCode == RESULT_OK)
        {   
    //I'm creating new file here (for this question is irelevant)
        } catch (IOException e) {

            e.printStackTrace();
        }

        Intent myIntent = new Intent(getBaseContext(), com.test.activities.SaveFileActivity.class);
        myIntent.putExtra("image", newPath);
        startActivityFromChild(this, myIntent, SAVE_ITEM);  
        finishFromChild(this);
    }

}

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putString("uri",outputFile.getPath());
}

After picture is captured, I press DONE button and I go to SaveFileActivity. Everyting works fine, until I try from SaveFIleActivity to go to another activity, then camera is starting again. Where should I look for the problem ? Maybe I should kill camera intent, but when ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:19:07+00:00Added an answer on May 22, 2026 at 11:19 pm

    I suspect you want to be using the simpler startActivity() and finish() methods instead of startActivityFromChild() and finishFromChild(). I admit, however, that I’m a bit unclear as to what the use of the ones you are actually for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a little problem about using jQuery (I really do not know jQuery
i have a little problem with dismissing my camera view. im using the UIImagePickerController
I have a little problem with a query. I'm selecting data using the between
i have little problem in using my application application having msaccess database if i
I have a little problem with following VHDL code: process (zbroji) begin if rising_edge(zbroji)
I have a little problem because I don't know whats the best way to
have a little problem with this code: UITableViewCell *cell = (UITableViewCell *)[[button superview] superview];
I have a little problem right now and I don't know how to fix
I have one little problem...Here is my code..Is there a way to distribute weights
I have little problem with my script. Here is the code. http://pastie.org/2361140 When I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.