Advertisement
Guest User

Untitled

a guest
Jul 24th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.17 KB | None | 0 0
  1.     ACTIVITY 1
  2.  
  3.  
  4.    @Override
  5. public void onCreate(Bundle savedInstanceState) {
  6.     super.onCreate(savedInstanceState);
  7.  
  8.     // Get the message from the intent
  9.     Intent intent = getIntent();
  10.  
  11.         if (resultCode != RESULT_OK) {
  12.             // ignore other result codes
  13.             return;
  14.         }
  15.  
  16.        final String emoloco = intent.getStringExtra(Extra.EMOTICON);              
  17.                  
  18.                 final String emoto = emoloco + ": ";                  
  19.  
  20.                 EditText input = (EditText) findViewById(R.id.input);
  21.                 input.setText(emoto);
  22.                 input.setSelection(emoto.length());
  23.         setContentView(textView);
  24.  
  25.  
  26.     }  
  27.  
  28.  
  29. ACTIVITY 2
  30.    
  31.  
  32. public class EmoticonActivity extends Activity
  33. {
  34.  
  35.     @Override
  36.     public void onCreate(Bundle savedInstanceState)
  37.     {
  38.         super.onCreate(savedInstanceState);
  39.  
  40.         setContentView(R.layout.emoticon);  
  41.    
  42.      
  43.     }
  44.    
  45.  
  46.  
  47.     public void smil1(View v) {
  48.             String emosio = ":)";
  49.             Intent intent = new Intent(this, Activity1.class);
  50.             intent.putExtra(Extra.EMOTICON, emosio);
  51.             startActivity(intent);
  52.  
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement