Close application at Android Studio

We can close application with this script in android studio.

import android.view.View.OnClickListener;
buttonClose = (Button) findViewById(;
buttonClose.setOnClickListener(new OnClickListener() {
 public void onClick(View arg0) {
 // TODO Auto-generated method stub
 Intent intent = new Intent(Intent.ACTION_MAIN);


Android Studio

Android Studio, yah this one is Android application development.

Android Studio is an integrated development environment (IDE) for developing for the Android platform. It was announced on May 16, 2013 at the Google I/O conference by Google‘s Product Manager, Katherine Chou. Android Studio is freely available under the Apache License 2.0.[3]

Android Studio was in early access preview stage starting from version 0.1 in May 2013, then entered beta stage starting from version 0.8 which was released in June 2014.[4] The first stable build was released in December 2014, starting from version 1.0.[5]

Based on JetBrainsIntelliJ IDEA software, Android Studio is designed specifically for Android development.[6] It is available for download on Windows, Mac OS X and Linux,[7][8] and replaced Eclipse Android Development Tools (ADT) as Google’s primary IDE for native Android application development.