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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:58:36+00:00 2026-06-12T18:58:36+00:00

I have an imagepath in android .This image exits on the sdcard of the

  • 0

I have an imagepath in android .This image exits on the sdcard of the device. How can i find resourceID of it ? I need to send it to decodeResource function. I am trying to detect faces on the image user selects from the gallery. The code that I have written is

    Intent intent = new Intent(this, DetectFaces.class);
    intent.putExtra(PICTURE_PATH,picturePath);//the path of the image
    startActivity(intent);

In detectFaces class

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detect_faces);
       // getActionBar().setDisplayHomeAsUpEnabled(true);
        Intent intent = getIntent();
        ImageView imageView = (ImageView) findViewById(R.id.imgView);
        picturePath = intent.getStringExtra(GetFaceActivity.PICTURE_PATH);
        imageView.setImageBitmap(BitmapFactory.decodeFile(picturePath));
        //imageView.setOnTouchListener(this);

    } 

There is a button whose onClick event is associated with

public void DetectFacesInImage(View view)
{
    BitmapFactory.Options bitmapFactoryOptions=new BitmapFactory.Options();
    bitmapFactoryOptions.inPreferredConfig= Bitmap.Config.RGB_565;
myBitmap=BitmapFactory.decodeResource(getResources(),R.drawable.faceswapping,bitmapFactoryOptions);
    int width=myBitmap.getWidth();
    int height=myBitmap.getHeight();
    detectedFaces=new FaceDetector.Face[number_of_faces];
    FaceDetector faceDetector=new FaceDetector(width,height,number_of_faces);
    number_of_faces_detected = faceDetector.findFaces(myBitmap, detectedFaces);

 }

I need ID in the decodeResource function. Any hints ?

  • 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-12T18:58:37+00:00Added an answer on June 12, 2026 at 6:58 pm

    Try this, it may help you

    File fileObj = new  File(“/sdcard/Images/test_image.jpg”);
    if(fileObj .exists()){
        Bitmap bitMapObj= BitmapFactory.decodeFile(fileObj .getAbsolutePath());
        ImageView imgView= (ImageView) findViewById(R.id.imageviewTest);
        imgView.setImageBitmap(bitMapObj);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

so i have this script: <script type=text/javascript> $(window).load(function () { var imagePath = new
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
I'm trying to develop an Android 3.1 tablet application. This app will have a
Look this what i have string imagePath = http:// & ConfigurationManager.AppSettings(DomainName) & /images/ htmlstring
I have an app where the user can choose an image either from the
I have this type of image path String img_path = R.drawable.+lower+_25; lower contain dynamic
I have tried starting the camera in android using an intent, something like this:
I am developing an android application in which I have to upload image from
I have a query in my android app that pulls all image paths from
I am new In Android.I have done zooming in image view.Now facing some problem.

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.