kernel_memory_dump

Untitled

Apr 11th, 2014
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.84 KB | None | 0 0
  1. package com.example.guip;
  2.  
  3. import android.app.Activity;
  4. import android.app.ActionBar;
  5. import android.app.Fragment;
  6. import android.os.Bundle;
  7. import android.view.LayoutInflater;
  8. import android.view.Menu;
  9. import android.view.MenuItem;
  10. import android.view.View;
  11. import android.widget.Button;
  12. import android.widget.Toast;
  13. import android.os.Build;
  14.  
  15. public class MainActivity extends Activity {
  16.  
  17.     @Override
  18.     protected void onCreate(Bundle savedInstanceState) {
  19.         super.onCreate(savedInstanceState);
  20.         setContentView(R.layout.activity_main);
  21.        
  22.      
  23.     }
  24.  
  25.     // SVAKO  (KLASU) DETE MOZEMO DA GLEDAMO KAO  (KLASU)
  26.     // RODITELJA
  27.     //  View RODITELJ SVIH GUI ELEMENATA
  28.    
  29.     public void metoda1 (View element) {
  30.         // CTRL + SHIFT + O
  31.         // da li je kliknuto na button?
  32.         // BUTTON JE DETE OD VIEW !!!!
  33.         // ako jeste instanceof ce vratiti true
  34.         // tada znamo da imamo button!
  35.        
  36.         if (element instanceof Button){
  37.             Button elementKaoButton = (Button) element;
  38.             Toast.makeText(getApplicationContext(),elementKaoButton.getText(), Toast.LENGTH_LONG).show();
  39.         }
  40.     }
  41.    
  42.  
  43.     @Override
  44.     public boolean onCreateOptionsMenu(Menu menu) {
  45.        
  46.         // Inflate the menu; this adds items to the action bar if it is present.
  47.         getMenuInflater().inflate(R.menu.main, menu);
  48.         return true;
  49.     }
  50.  
  51.     @Override
  52.     public boolean onOptionsItemSelected(MenuItem item) {
  53.         // Handle action bar item clicks here. The action bar will
  54.         // automatically handle clicks on the Home/Up button, so long
  55.         // as you specify a parent activity in AndroidManifest.xml.
  56.         int id = item.getItemId();
  57.         if (id == R.id.action_settings) {
  58.             return true;
  59.         }
  60.         return super.onOptionsItemSelected(item);
  61.     }
  62.  
  63.  
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment