Android Working with Floating Action Button

build.gradle

compile 'com.android.support:design:25.3.0'

/res/layout/activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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.mahmood.a057.MainActivity">

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/floatingActionButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentEnd="true"
        android:layout_alignParentRight="true"
        android:layout_margin="8dp"
        android:visibility="visible"
        app:elevation="8dp"
        app:fabSize="normal"
        app:backgroundTint="#FF0000"
        app:srcCompat="@drawable/ic_backup" />

</RelativeLayout>

MainActivity.java
public class MainActivity extends AppCompatActivity {

    FloatingActionButton floatingActionButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        floatingActionButton= (FloatingActionButton) findViewById(R.id.floatingActionButton);
        floatingActionButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(MainActivity.this,"Hello World",Toast.LENGTH_LONG).show();
            }
        });
    }
}

Refereneces
https://github.com/mhdr/AndroidSamples/tree/master/057
https://www.youtube.com/watch?v=nt31X9RaHQU&index=3&list=PLBA5zvAwnCrAG1ghh1XRsTN-Fqh3uKpli