Advertisement
Guest User

Android App

a guest
Sep 10th, 2013
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.26 KB | None | 0 0
  1. package com.projectclear.mijneersteapp;
  2.  
  3. import android.app.Activity;
  4. import android.content.Intent;
  5. import android.os.Bundle;
  6. import android.view.Menu;
  7. import android.view.MenuInflater;
  8. import android.view.View;
  9. import android.widget.EditText;
  10.  
  11.  
  12.  
  13. public class MainActivity extends Activity {
  14.     public final static String EXTRA_MESSAGE = "com.projectclear.mijneersteapp.MESSAGE";
  15.  
  16.     @Override
  17.     protected void onCreate(Bundle savedInstanceState) {
  18.         super.onCreate(savedInstanceState);
  19.         setContentView(R.layout.activity_main);
  20.     }
  21.  
  22.  
  23.     @Override
  24.     public boolean onCreateOptionsMenu(Menu menu) {
  25.         // Inflate the menu items for use in the action bar
  26.         MenuInflater inflater = getMenuInflater();
  27.         inflater.inflate(R.menu.main_activity_actions, menu);
  28.         return super.onCreateOptionsMenu(menu);
  29.     }
  30.    
  31.     /** Called when the user clicks the verzenden button */
  32.     public void sendMessage(View view){
  33.         // Doe shit
  34.         Intent intent = new Intent(this, DisplayMessageActivity.class);
  35.         EditText editText = (EditText) findViewById(R.id.edit_message);
  36.         String message = editText.getText().toString();
  37.         intent.putExtra(EXTRA_MESSAGE,  message);
  38.         startActivity(intent);
  39.        
  40.     }
  41.    
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement