title: How to transfer data from one app to another app in android
body: <p>So, what I need here is to send data from App1 to App2. I've tried with simple code that I've made, but something is wrong here. I want to make a simple input on 1 editText in app1 then it will be received by app2.</p>
  
  <p>Example :</p>
  
  <p>App1 : EditText -> I input 'Hello!'</p>
  
  <p>Then</p>
  
  <p>App2 : TextView -> 'Hello!'</p>
  
  <p>But what happens next, the textview in App2 does not show anything. What's wrong here?</p>
  
  <p>These are my code that I've tried.</p>
  
  <p>My Application 1:</p>
  
  <pre><code>secondAppButton = (Button)findViewById(R.id.secondAppButton);
      namaEditText = (EditText)findViewById(R.id.namaEditText);
  
      secondAppButton.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              String nama = namaEditText.getText().toString();
  
              Intent secondApp = getPackageManager().getLaunchIntentForPackage("com.example.yosua.myapplication2");
              Bundle bundleApp = new Bundle();
  
              bundleApp.putString("namaOrang", nama);
              secondApp.putExtras(bundleApp);
  
              startActivity(secondApp);
          }
      });
  </code></pre>
  
  <p>My Application 2:</p>
  
  <pre><code>namaDariApp1 = (TextView)findViewById(R.id.namaApp2);
  
      String nama;
  
      Intent intent = getIntent();
      Bundle extras = intent.getExtras();
  
      nama = extras.getString("namaOrang");
      namaDariApp1.setText(nama);
  </code></pre>