本文介绍了如何从另一个类调用活动中的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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 "";

    }
}





所以如何从LoginActivity.java中调用此BrokerRequest



我的尝试:





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.

推荐答案

BrokerCommunication inst = new BrokerCommunication();
inst.BrokerRequest("<your req URL here>", "<your req type here>");


这篇关于如何从另一个类调用活动中的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 16:00