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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:26:29+00:00 2026-05-18T05:26:29+00:00

I am in a single class, using 2 different methods. In one method I

  • 0

I am in a single class, using 2 different methods.

In one method I have:

private void detect();
    int facesFound = detector.findFaces(bitmap565, faces);

detector, bitmap565 and faces are all defined in the same method.

In another method, I would like to call the value of facesFound.

So:

private void crop(){
if (facesFound > 1){

}

My issue is, I cannot access that integer from the method because it is cast locally. What is my best way to alter my code to call it?

Edit: to add method:

private final View.OnClickListener btnClick = new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            switch (v.getId()) {
   case R.id.action_button:
        crop();

So are you saying declare an integer at the top of my class that is defined as getting the integer passed back through my new private int detect() method?

  • 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-18T05:26:30+00:00Added an answer on May 18, 2026 at 5:26 am

    Change detect() and crop() to:

    private int detect()
    {
        return detector.findFaces(bitmap565, faces);
    }
    
    private void crop(int numberOfFacesFound)
    {
        if(numberOfFacesFound > 1)
        {
    
        }
    }
    

    Then, wherever you are calling crop() from:

    int numberOfFacesFound = detect();
    crop(numberOfFacesFound);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I managed to create a class using CodeDom and add a single method to
I have a listener class that accepts GUI change events in one method. The
I am using CODBCRecordset (a class found on CodeProject) to find a single record
I have a class isSearching with a single boolean property in a 'functions' file
I've written a class with a single static method that copies property values from
I have dbml with single table users i want add partial class for User
I have a 'Purchase Order' class. It contains information about a single purchase order.
i have a module (a single .py file, actually), with a class called HashedDir.
I have a DAO class which I am using to do database operations. I
@Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) public class Problem { @ManyToOne private Person person; } @Entity

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.