title: java.lang.RuntimeException: Unable to resume activity Android
body: <p>I am trying to get the device bluetooth address so when ever I click on send </p>
  
  <pre><code>startActivityForResult(new Intent(getApplicationContext(),
                          DeviceListActivity.class), GET_DEVICE_TO_SEND);
  </code></pre>
  
  <p>file via bluetooth the Discovery starts when its done I select one of founded devices</p>
  
  <p>at the <code>onActivityResult</code> 
  I have these code</p>
  
  <pre><code>if (requestCode == GET_DEVICE_TO_SEND &amp;&amp; resultCode == RESULT_OK) {
  String device = data
  .getStringExtra(DeviceListActivity.DEVICE_ADDRESS);
  String name = data.getStringExtra(DeviceListActivity.DEVICE_NAME);
  </code></pre>
  
  <p>the function <code>onActivityResult</code>  is called and then the application stopp</p>
  
  <p>The class: <code>MainUI</code> contains the Tabhost .</p>
  
  <p>the class :<code>FilesUI</code>  is where the function <code>onActivityResult</code> is located</p>
  
  <p>The log</p>
  
  <pre><code>03-19 18:39:28.858: E/AndroidRuntime(22817): java.lang.RuntimeException: Unable to resume activity {com.android.Connect/com.android.Connect.UI.MainUI}: java.lang.RuntimeException:`enter code here` Failure delivering result ResultInfo{who=Files, request=1, result=-1, data=Intent { (has extras) }} to activity {com.android.Connect/com.android.Connect.UI.MainUI}: java.lang.NullPointerException
  </code></pre>