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 6381703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:25:45+00:00 2026-05-25T02:25:45+00:00

I want to start camera activity in my android app and I know how

  • 0

I want to start camera activity in my android app and I know how to do that. I want to ask when the camera activity finishes, how can I check as if it was the picture or the video taken by the user?

UPDATED

I have a dialog where it asks 2 things.

  1. New Photo or Video
  2. Existing Photo or Video

If it’s no. 1, it means camera will be started and user can either take a picture or the video and it will return to the activity.

If it’s no.2, it mean gallery will be started having pictures and videos for a user to select one and will return back to the activity.

  • 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-25T02:25:46+00:00Added an answer on May 25, 2026 at 2:25 am

    Hello Umair,
    I have done this type of application I searched many time but I didn’t get any proper solution so I changed your my menu & they are now
    1)Take New Photo
    2)Take New Video
    3)Existing Image/Video

    Process will be like this
    1)I use an global variable
    2)So when user click on menu one I sets global variable value to 1
    3) Start the activity for result like below

    try{
       System.gc();
       String fileName = System.currentTimeMillis()+".jpg";
       String mPathImage = Environment.getExternalStorageDirectory()+ "/" + fileName;
       File file = new File(mPathImage);
       Uri outputFileUri = Uri.fromFile( file );
       Intent mIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
       mIntent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri );
       startActivityForResult(mIntent, 1);
       mValue=1;
    

    }catch(Exception e){

    }

    If User click on menu 2 I change value of global variable to 2
    & starts the activity for result like below.

    try {
        System.gc();
        Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE);
        startActivityForResult(intent, 1);
        mValue=2;
    }catch(Exception e){}
    

    If user click on 3rd menu I set value to 3
    & start the activity for result like below.

    try{
       System.gc();
       Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
       intent.setType("*/*");
       startActivityForResult(intent,1);
       mValue=3;
    }catch(Exception e){}
    }
    

    This will show all the images & video’s in mobile

    Then finally when activity gets closed use global variable to check whether user want to new image or video or existing image/video.

    Hope this will help you..

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

Sidebar

Related Questions

I want to start using .NET 3.5 features in an app that is currently
I am currently writing an app that within a certain activity, we want the
I want to be able to control a DSLR camera to start/stop recording video.
I want to start using Python for small projects but the fact that a
I want to start working with TDD but I don't know really where to
I want to start learning HTML and AJAX using a Linux distribution. Can anyone
So far I have my app taking a picture AndroidCamera.java using the camera and
I am going to implement camera feature for my android app.for this, I searched
I am using an activity to capture image i want to start a finish
in my app i want use the camera for capturing image and send to

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.