Advertisement
Guest User

Untitled

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