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?
Change
detect()andcrop()to:Then, wherever you are calling
crop()from: