Twilio Client for Android Quickstart Tutorial

Hanging Up Calls from your Android Device

Congratulations on making your first audio connection from your Android device to Twilio!

You should have heard a welcome message but as you probably noticed, you had no way to close the connection as the Hangup button doesn't do anything. So, let's add code in MonkeyPhone to hang up ongoing connection.
public void disconnect()
    if (connection != null) {
        connection = null;

And add code in HelloMonkeyActivity to call this new method when the hangup button is pressed:
public void onClick(View view)
    if (view.getId() == {
    }  else if (view.getId() == {

That's everything! Go ahead and make another call. You can now press the hangup button at any time and your connection will close.
Next: Connecting to a TwiML Application »