title: findViewById() in OnActivityResult function causes crash
body: <p>In onActivityResult function I create layout and button in this layout. And when I press the button, I want to edit data in it by calling a new activity. I received data from new activity and want to find button by id to apply changes. But function findViewById causes crash of my application. How can I fix it?</p>
  
  <p>This is part of my code:</p>
  
  <pre><code>if(requestCode == EditingMedicine)
      {
          if(resultCode == RESULT_OK)
          {
              int _id = data.getIntExtra(AddEditMedicineActivity.Id, -1);
              String medName = data.getStringExtra(AddEditMedicineActivity.medName);
              String medTime = data.getStringExtra(AddEditMedicineActivity.medTime);              
              Button btn = (Button)findViewById(_id);
              btn.setText(Html.fromHtml(medName + " &lt;br/&gt;" + medTime));
          }
      }
  </code></pre>
  
  <p>Thanks.</p>