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

The Archive Base Latest Questions

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

I can not figure out what I am doing wrong. I have 2 methods,

  • 0

I can not figure out what I am doing wrong. I have 2 methods, this one which works:

protected void applySelection(String adjustment, String action){
    if(!adjustment.equals("") || !action.equals("")){
        try{
            ClassLoader myClassLoader = this.getClass().getClassLoader();
            String myPackage = this.getClass().getPackage().getName();
            String classNameToBeLoaded = myPackage + "." + action + "." + adjustment;
            Class adjust = myClassLoader.loadClass(classNameToBeLoaded);
            Object whatInstance = adjust.newInstance();
            adjust.getMethod("setBitmap", new Class[]{Bitmap.class}).invoke(whatInstance, new Object[]{this.stage.getImage()});
            Bitmap bmp = (Bitmap)adjust.getMethod("applyFilter").invoke(whatInstance);
            if(bmp != null){
                Edit.this.stage.setStageImage(bmp);
                Edit.this.stage.showTopItems(bmp);
            }
        }catch(IllegalArgumentException e){
        }catch(IllegalAccessException e){
        }catch(InvocationTargetException e){
        }catch(Exception e){}
    }
}

then this one which doesn’t work:

protected void setFromSlider(String adjustment, String action){
    if(!adjustment.equals("") || !action.equals("")){
        try{
            ClassLoader myClassLoader = this.getClass().getClassLoader();
            String myPackage = this.getClass().getPackage().getName();
            String classNameToBeLoaded = myPackage + "." + action + "." + adjustment;
            Class adjust = myClassLoader.loadClass(classNameToBeLoaded);
            Object whatInstance = adjust.newInstance();
            Object returnVal = adjust.getMethod("isSeekBar").invoke(whatInstance);
            if(returnVal == true){
                // Do something
            }else{
                // Do something else
            }
        }catch(NullPointerException e){
            e.getMessage();
        }catch(IllegalArgumentException e){
            e.getMessage();
        }catch(IllegalAccessException e){
            e.getMessage();
        }catch(Exception e){
            e.getMessage();
        }
    }
}

On this line (in the second method):
Object returnVal = adjust.getMethod("isSeekBar").invoke(whatInstance);

when It gets here, it just skips over my if statement and goes directly to the closing brace of the method. What is causing that? Here is the method that is being called:

public boolean isSeekBar(){
    return true;
}

I am assuming that it is throwing an error, but none of the catch statements are catching one. I am now stumped…

  • 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:07:01+00:00Added an answer on June 13, 2026 at 11:07 pm

    You can try catching the more generic Throwable – if this function is executed in the UI thread you will not see the exception.

    try{
         ...
    }catch(Throwable e){
       // e.getMessage(); this would not print anything
       e.printStackTrace();
    }
    

    in any case, if(returnVal == true){ does not compile (Incompatible operand types Object and boolean)

    Use if (returnVal.equals(true)) {

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

Sidebar

Related Questions

I can't seem to figure out what I am doing wrong here. I have
I have something of a logical puzzle I can not figure out. I have
I have to implement simple ray tracing algorithm, but I can not figure out
I think I am just doing something stupid but I can't figure this one
I can not figure out why my rich:dataTable is not rendering. I am using
For the life of me, I can not figure out why some styles are
I use a Mahout (version 0.8) and MySQL. I can not figure out how
I can not seem to figure out how to count the number of seconds
I can not for the life of me, figure out how I can reposition
Can someone figure out how to get rid of the NOT EXISTS statements in

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.