Advertisement
Guest User

Untitled

a guest
Sep 26th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.28 KB | None | 0 0
  1. package com.example.gradiradianti;
  2.  
  3. import android.support.v7.app.ActionBarActivity;
  4. import android.os.Bundle;
  5. import android.view.Menu;
  6. import android.view.MenuItem;
  7. import android.view.View;
  8. import android.view.View.OnClickListener;
  9. import android.widget.Button;
  10.  
  11. public class MainActivity extends ActionBarActivity {
  12.    
  13.     final Button buttonx = (Button) findViewById(R.id.button1);
  14.    
  15.     buttonx.setOnClickListener(new OnClickListener() {
  16.         public void onClick(View v) {
  17.             // Perform action on clicks
  18.  
  19.         }
  20.     });
  21.    
  22.     @Override
  23.     protected void onCreate(Bundle savedInstanceState) {
  24.         super.onCreate(savedInstanceState);
  25.         setContentView(R.layout.activity_main);
  26.     }
  27.  
  28.     @Override
  29.     public boolean onCreateOptionsMenu(Menu menu) {
  30.         // Inflate the menu; this adds items to the action bar if it is present.
  31.         getMenuInflater().inflate(R.menu.main, menu);
  32.         return true;
  33.     }
  34.  
  35.     @Override
  36.     public boolean onOptionsItemSelected(MenuItem item) {
  37.         // Handle action bar item clicks here. The action bar will
  38.         // automatically handle clicks on the Home/Up button, so long
  39.         // as you specify a parent activity in AndroidManifest.xml.
  40.         int id = item.getItemId();
  41.         if (id == R.id.action_settings) {
  42.             return true;
  43.         }
  44.         return super.onOptionsItemSelected(item);
  45.     }
  46.    
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement