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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:07:01+00:00 2026-06-15T00:07:01+00:00

I have a application to capture photo which will display on ImageView (and do

  • 0

I have a application to capture photo which will display on ImageView (and do some more work internally).

Problem is here when I open camera and after capturing photo, save and discard option come, after clicking on save button it again go to the camera mode.

This problem not occur when I clean the memory of phone(Task Manager ->> Ram ->> Clear Memory).

I thing the problem is: Camera Intent not give result when there is not sufficient memory.
But when I open normal Camera then it capture the photo.

How I solve this problem.
One solution is here every time clean memory before launching my application.

But this is not a right way because when I introduce my application to general people then they do not do these thing.

Now what I need to do here?

Is there any way to clean the memory by my application?
How I know what the minimum or maximum memory is utilized by my application. So first my application check, is there, that much memory available or not. If available then proceed otherwise tell user to clean(or uninstall some application) some memory.

I am using following code in my application:

layout->

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<Button 
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:text="@string/photo"
    />

<ImageView 
    android:id="@+id/image"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@id/button1"
    android:contentDescription="@string/image"/>
</RelativeLayout>

activity->>

public class TestCameraActivity extends Activity {

private Button button;
private ImageView imageView;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_test_camera);

    button = (Button) findViewById(R.id.button1);
    imageView = (ImageView) findViewById(R.id.image);

    button.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
            startActivityForResult(intent, 100);
        }
    });
}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == 100) {
        Bitmap bitmap = (Bitmap) data.getExtras().get("data");
        imageView.setImageBitmap(bitmap);
    }
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_test_camera, menu);
    return true;
}

}
  • 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-15T00:07:03+00:00Added an answer on June 15, 2026 at 12:07 am

    May be you are not properly calling CameraIntent, try below code, hope it works:

    CameraIntent

    String filepath = Environment.getExternalStorageDirectory()+"/foldername/"+filename;
    System.out.println("thumbnail path~~~~~~"+filepath);
    File file = new File(filepath);
    Uri outputFileUri = Uri.fromFile(file);
    
    Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
    intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
    startActivityForResult(intent, 100);
    

    onActivityResult

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
            if (requestCode == 100) {
            sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://"+ Environment.getExternalStorageDirectory())));
            Bitmap bitmap;
            bitmap=GlobalMethods.decodeFile(_path);//function to decode.
            if (bitmap == null) {
                ivPhy.setImageBitmap(bitmap);
            } 
            else {
                ivPhy.setImageBitmap(bitmap);
                ivPhy.setScaleType(ScaleType.FIT_XY);
            }
        }
    
    
    }
    

    Manifest Permission

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-feature android:name="android.hardware.camera" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a photo/video capture application. I have created a CaptureView
We have an application that will capture different images from users and make them
I have an Web-application in which I capture Image using EdgeCamShots Sample Application Saving
I have made a sample application which constructs a filter graph to capture audio
I have build an Android application which capture images and save in the /mnt/sdcard/Pictures/MyFolder
I have a application that will capture the screen and I want to write
I have an application in Zend where I need to implement system which will
I have an application (video stream capture) which constantly writes its data to a
I have an application in which I'm trying to capture the shift key modifier
I have an application which uses PreviewKeyDown to capture CTRL X keystrokes (where X

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.