Failure delivering result ResultInfo who=null, request=2, result=-1, data=Intent
<p>i am calling an activity using the intent like this.</p>

<p><code>Intent searchIntent=new Intent(YoutubeActivity.this,KeyboardDialog.class);
                startActivityForResult(searchIntent, 2);</code></p>

<p>In other activity i am sending result like the following way.After clicking the button.</p>

<pre><code>    Intent returnIntent=new Intent();
    holder = txt_search.getText().toString();
    returnIntent.putExtra("Search",holder);
    Log.w("in OnClick","h ::"+holder);
    setResult(RESULT_OK,returnIntent);
    finish();
</code></pre>

<p>And in YoutubeActivity onActivityResult() implementation is following.</p>

<pre><code>@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//      super.onActivityResult(requestCode, resultCode, data);
        Toast.makeText(this, "onactivity result called", Toast.LENGTH_SHORT).show();
        if(resultCode==RESULT_OK)
        {
            searchQuery=data.getStringExtra("Search");
            Log.w("in onActivityResult "," searchQuery ::"+searchQuery);

            if(searchQuery.length()&gt;0)
            {
                if(searchQueryList.size()&lt;10)
                {
                    searchQueryList.add(searchQuery);   
                }
                else 
                {
                    searchQueryList.remove(0);
                }
                System.out.println("before genre adapter");
                genreAdapter=new GenreAdapter(getApplicationContext(), YoutubeActivity.this, R.layout.youtubesecondrowlist1, searchQueryList);
                System.out.println("after genre adapter");
                System.out.println("before set adapter");
                youtubeSecondRowList.setAdapter(genreAdapter);
                System.out.println("after set adapter");

                jsonData();
            }
        }

    }
</code></pre>

<p>In this method we get the RuntimeException logcat is below.</p>

<pre><code>W/in OnClick(22565): h ::asd
W/in OnClick DONE(22565): textvalue ::asd
W/in onActivityResult (22565):  searchQuery ::asd
I/System.out(22565): before genre adapter
I/System.out(22565): after genre adapter
I/System.out(22565): before set adapter
D/AndroidRuntime(22565): Shutting down VM
W/dalvikvm(22565): threadid=1: thread exiting with uncaught exception (group=0x401db560)
E/AndroidRuntime(22565): FATAL EXCEPTION: main
E/AndroidRuntime(22565): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=2, result=-1, data=Intent { (has extras) }} to activity {com.youtube/com.youtube.YoutubeActivity}: java.lang.NullPointerException
E/AndroidRuntime(22565):        at android.app.ActivityThread.deliverResults(ActivityThread.java:2532)
E/AndroidRuntime(22565):        at android.app.ActivityThread.handleSendResult(ActivityThread.java:2574)
E/AndroidRuntime(22565):        at android.app.ActivityThread.access$2000(ActivityThread.java:117)
E/AndroidRuntime(22565):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:961)
E/AndroidRuntime(22565):        at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(22565):        at android.os.Looper.loop(Looper.java:130)
E/AndroidRuntime(22565):        at android.app.ActivityThread.main(ActivityThread.java:3683)
E/AndroidRuntime(22565):        at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(22565):        at java.lang.reflect.Method.invoke(Method.java:507)
E/AndroidRuntime(22565):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
E/AndroidRuntime(22565):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
E/AndroidRuntime(22565):        at dalvik.system.NativeStart.main(Native Met
W/ActivityManager( 1133):   Force finishing activity com.youtube/.YoutubeActivity
W/ActivityManager( 1133): Activity pause timeout for HistoryRecord{40857810 com.youtube/.YoutubeActivity}
</code></pre>

<p>it works upto System.out.println("before set adapter");after that we get this exception.</p>

<p>i don't know exactly what it is..</p>

<p>please help me.thanks in advance..</p>
