开发者

Using button in Android to call an activity and a web service

I want to know whether a single button in Android can call a web service as well as start another activity i.e move to another splash screen when pressed.

Is t开发者_如何学运维his possible ? Can a single button have two Events ? If yes,how ?


A button can have only one ClickListener but you call a web service and start an activity from this listener.

EDIT:

button.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        callWebService();
        startAnotherActivity();
    }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜