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

  • Home
  • SEARCH
  • 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 8108807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:13:40+00:00 2026-06-06T01:13:40+00:00

I am using the camera by creating an intent: Intent cameraI = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);

  • 0

I am using the camera by creating an intent:

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

and then starting it with:

startActivityForResult(cameraI, request);

where request is a predefined constant integer.

I then have the onActivityResult():

public void onActivityResult(int req, int res, Intent data) throws NullPointerException
{
    try{

    super.onActivityResult(req, res, data);
    if(req == request)
    {
        Bitmap picture = (Bitmap) data.getExtras().get("data");
        ImageView image = (ImageView) findViewById(R.id.imageView1);
        image.setImageBitmap(picture);
    }//if
    else
    {
        Toast.makeText(getApplicationContext(), "No picture taken", 4);
    }//else
    }catch (NullPointerException e){
        String error = "null pointer exception";
        Toast.makeText(getApplicationContext(), error, 4);
    }
}//onActivityResult

My predicament is that I do not have a camera on this computer. I get eclipse’s default checkerboard and moving square animation. Does this actually function? I have been clicking the “take picture” button but nothing is happening. What I want to happen is to take a single picture, and then return it to the activity that called i. Is that the default action or do I have to specify that I want it to return after taking one picture?

Thanks in advance for any help.

  • 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-06-06T01:13:43+00:00Added an answer on June 6, 2026 at 1:13 am

    The code in question ended up working. Upon testing on a device, the picture was returned as desired. Eclipse’s emulated camera simply did not work. If i recall correctly you can enable a camera, but that is a different discussion entirely.

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

Sidebar

Related Questions

I'm new to developing apps in Android. We are currently creating a robot using
In my application I want to capture two images using camera and then I
I am invoking a camera using an intent and clicking a picture. Presently I
When I take pictures using android.hardware.camera and I save them to the following location
Im using Bluetooth to transfer image from Android camera.callback to PC. on windows side
I have an app in android using camera with opencv which runs for about
For example (using android) if I want to declare a constant of a Camera.Size
I'm trying to capture an image using Android Camera via simple activity. Image is
I have an android app which uses camera. I am using a socket connection
I am using camera in my app. I am just using intent to start

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.