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();
}
});
精彩评论