Passing paramaters using NameValuePair
<p>I have the application to take the photo and send it to server. The taking photo and server(accept image) run perfectly separately. When I try to use below code after taking photo to send server, it causes to force to close the application. Here is the code: </p>

<pre><code>protected void onActivityResult(int requestCode, int resultCode, Intent data){
   if (resultCode == RESULT_OK){
      Uri imageUri=data.getData();
      List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;(1);
      params.add(new BasicNameValuePair("image", imageUri.getPath()));
      post("http://myserver-address",params);
   }
}
</code></pre>

<p>post method is same as <a href="http://stackoverflow.com/questions/2935946/sending-images-using-http-post">Sending images using Http Post</a></p>

<p>Log cat says: </p>

<pre><code>java.lang.RuntimeException: Unable to resume activity
{com.john.smith/com.john.smith.Activity}: java.lang.RuntimeException:
Failure delivering result ResultInfo{who=null, request=1, result=-1, data=null}
to activity {com.john.smith/com.john.smith.Activity}:
   java.lang.NullPointerException
</code></pre>

<p>I think, there is something wrong for passing parameters to send function. Because, I try disable all the lines in my send function, still face the error. And this error causes to force the application close. </p>

<p>How can I fix that problem ? How to pass the photo to <code>send</code> function other than mine ? </p>

<p><strong>Update:</strong></p>

<p>my camera capture code is same as 
<a href="http://code.google.com/p/crw-cmu/source/browse/luis/PhotoIntentActivity/src/com/example/android/photobyintent/PhotoIntentActivity.java?r=734" rel="nofollow">http://code.google.com/p/crw-cmu/source/browse/luis/PhotoIntentActivity/src/com/example/android/photobyintent/PhotoIntentActivity.java?r=734</a></p>

<p>I call it like that </p>

<pre><code>     protected void onActivityResult(int requestCode, int resultCode, Intent data){

        switch (requestCode) {
        case ACTION_TAKE_PHOTO_B: {
            if (resultCode == RESULT_OK) {
            handleBigCameraPhoto();
          Uri imageUri=data.getData();
          List&lt;NameValuePair&gt; params = new ArrayList&lt;NameValuePair&gt;(1);
          params.add(new BasicNameValuePair("image", imageUri.getPath()));
          post("http://myserver-address",params);
        }
            }
            break;
        } // ACTION_TAKE_PHOTO_B

    } // switch
}
</code></pre>
