xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="${relativePackage}.${activityClass}" >
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
public class MainActivity extends Activity implements OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
switch (v.getId()) {
case R.id.btn_1:
Toast.makeText(MainActivity.this, ((Button)v).getText(), Toast.LENGTH_SHORT).show();;
break;
case R.id.btn_2:
Toast.makeText(MainActivity.this, ((Button)v).getText(), Toast.LENGTH_SHORT).show();;
break;
case R.id.btn_3:
Toast.makeText(MainActivity.this, ((Button)v).getText(), Toast.LENGTH_SHORT).show();;
break;
case R.id.btn_4:
Toast.makeText(MainActivity.this, ((Button)v).getText(), Toast.LENGTH_SHORT).show();;
break;
case R.id.btn_5:
Toast.makeText(MainActivity.this, ((Button)v).getText(), Toast.LENGTH_SHORT).show();;
break;
default:
break;
}
}
}