title: How to change textview text from another activity on button click in android studio?
body: <p>I have seen a lot of tutorials that gives answer for this, but I don't get it. It isn't working. I have a button in <code>MainActivity</code>, that has click listener that does this:</p>
  
  <pre><code> Intent i = new Intent(MainActivity.this, DetailsActivity.class);
       i.putExtra("Name", "RESULT");
       startActivity(i);
  </code></pre>
  
  <p>Another actiivty:</p>
  
  <pre><code>txtview = (TextView) find.....(R.id.textView1);
  Intent i = getIntent();
  String str = i.getStringExtra("Name");
  txtview.setText(str);
  </code></pre>
  
  <p>I don't use an emulator, I build the apk and then transfer it to my mobile. So in my mobile when I click the button, it closes and says "The app is not responding"
  XML:</p>
  
  <pre><code>&lt;TextView
      android:text="result"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentTop="true"
      android:layout_centerHorizontal="true"
      android:layout_marginTop="145dp"
      android:id="@+id/txt" /&gt;
  </code></pre>