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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:29:28+00:00 2026-06-13T23:29:28+00:00

Using the google developer tutorials and following them exactly and my app will just

  • 0

Using the google developer tutorials and following them exactly and my app will just restart or completely shut down and not get the picture from the camera. I had the exact same code working about 30 minutes ago but now it wont work. All I did was try and implement a button. Any help is greatly appreciated.

HEre is my code. Its short and simple so hopefully someone can give some advice on where to go from here.

package com.example.camera;

import android.app.Activity;
 import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
 import android.os.Bundle;
 import android.provider.MediaStore;
 import android.widget.ImageView;

public class MainActivity extends Activity {
ImageView iv;
Bitmap bitmap;
private static final int actionCode = 100;
public static final int MEDIA_TYPE_IMAGE = 1;

@Override
 public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
iv=(ImageView)findViewById(R.id.imageView1);
dispatchTakePictureIntent(actionCode);
}



protected void onActivityResult(int requestCode, int resultCode, Intent data) {
 handleSmallCameraPhoto(data);
 }

private void dispatchTakePictureIntent(int actionCode) {
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(takePictureIntent, actionCode);
    }

private void handleSmallCameraPhoto(Intent intent) {
    Bundle extras = intent.getExtras();
    bitmap = (Bitmap) extras.get("data");
   iv.setImageBitmap(bitmap);
}
     }
  • 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-13T23:29:29+00:00Added an answer on June 13, 2026 at 11:29 pm

    Some times it does get messy to ask the android system to take images for you. I have a Camera Library Project you can use the library to take the picture sample is also provided. or you can go through the code to understand it

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

Sidebar

Related Questions

I want to develop my application using google app engine into which I will
I'm using the HelloAndroidTest tutorial from Google: http://developer.android.com/resources/tutorials/testing/helloandroid_test.html . Here's the test class: package
When debugging browser-based apps using Google Chrome's Developer Tools, is there a way to
I want to develop some web apps using Google app engine. I had deployed
I'm using the Google Chrome Developer Tools plugin for Eclipse to debug my Node.js
I'm using http://developer.android.com/resources/tutorials/views/hello-mapview.html#top tutorial to show multi location in the map using markers.but it
I'm using Facebook Graph API on Google App Engine. I was able to fetch
I've searched through Google, FMS Guru and a ton of Adobe developer tutorials. I'm
I know how to 'break' on all subtree modifications using google developer tools, but
my program is based on Google's Hello Gallery example: http://developer.android.com/guide/tutorials/views/hello-gallery.html Instead of using images,

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.