<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.example.aris.hellotoast.MainActivity">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:layout_editor_absoluteX="8dp"
        tools:layout_editor_absoluteY="8dp">

        <Button
            android:text="SET"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_marginTop="35dp"
            android:id="@+id/button_toast"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:onClick="showToast"
            />

        <Button
            android:text="TAMBAH"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/button_count"
            android:layout_marginBottom="57dp"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:onClick="countUp"/>

        <TextView
            android:text="0"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/show_count"
            android:textSize="100sp"
            android:textAlignment="center"
            android:background="@color/colorAccent"
            android:layout_below="@+id/button_toast"
            android:layout_alignParentLeft="true"
            android:layout_alignParentStart="true"
            android:layout_above="@+id/button_count"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            android:elevation="1dp" />
    </RelativeLayout>
</android.support.constraint.ConstraintLayout>


MainActivity.java
package com.example.aris.hellotoast;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    private TextView mShowCount;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    public void showToast(View view) {
        mShowCount = (TextView) findViewById(R.id.show_count);
        Toast.makeText(MainActivity.this, "Toast Success", Toast.LENGTH_SHORT).show();
    }
    public void countUp(View view) {
        int mCount = Integer.valueOf(String.valueOf(mShowCount.getText()));
        mCount++;
        if (mShowCount != null)
            mShowCount.setText(Integer.toString(mCount));

    }

}
