Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
public class BrokerCommunication {

    public String BrokerCommRequest(String url)
    {
        try
        {

        }
        catch (Exception e) {
            // TODO: handle exception
        }

        return "";
    }

    public String BrokerRequest(String _reqUrl,String _reqType)
    {
        try
        {

        }
        catch (Exception e) {
            // TODO: handle exception
        }

        return "";
            
    }
}


So how to I Call this BrokerRequest from LoginActivity.java

What I have tried:

BrokerCommunication inst = new BrokerCommunication();
              inst.BrokerRequest();

I tried like this but its showing error of change signature.
Posted
Updated 17-Aug-17 23:22pm

1 solution

The problem with the way you currently call the method, is that you don't pass any arguments: BrokerRequest takes two String arguments, but you do inst.BrokerRequest() so you aren't passing anything.

Do something like this:
Java
BrokerCommunication inst = new BrokerCommunication();
inst.BrokerRequest("<your req URL here>", "<your req type here>");
 
Share this answer
 
Comments
Member 13233111 18-Aug-17 5:41am    
What if I want to call BrokerCommunication.java page on buttonclick?
Thomas Daniels 18-Aug-17 5:48am    
Then you call the BrokerRequest method in the handler of your button click event.
Member 13233111 18-Aug-17 6:24am    
Please ProgramFox answer to this https://www.codeproject.com/Questions/1201969/How-do-I-pass-this-edittext-ID-to-the-services
Thomas Daniels 18-Aug-17 6:26am    
That's hardly a question. I'm not going to try to understand such a big piece of code, especially if I have no idea what the problem actually is.
Member 13233111 18-Aug-17 6:29am    
How do I pass EditText parameter to BrokerCommunication page? Please help me am Trapped.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900