If you are not wanting to return info to Activity A from Activity B, just 
use startActivity() in Activity A instead of startActivityForResult().

If you use startActivityForResult() to launch Activity B from Activity A, 
Activity A expects Activity B to send information back when it closes. You'd 
use something like this if you wanted to send information back from Activity 
B to Activity A after calling startActivityForResult() from Activity A.

Intent iReturn = new Intent();
iReturn.putExtra( "someKey", someValue );
setResult( RESULT_OK, iReturn );
finish();

But again, if you aren't wanting a return, use startActivity() to start 
Activity B.

Steven
Studio LFP
http://www.studio-lfp.com


On Saturday, October 22, 2011 10:35:43 AM UTC-5, ndiiie90 wrote:
>
> hmm not really.. 
>
> actually the error is only about when i press back button from 
> activity B, it returns to activity A (where i implement the facebook 
> sdk) but the facebook sdk returns error about nullPointerException 
> since the startActivityForResult has no data for it parameters. 
> how can i solve this? 
>
>
> On Oct 22, 10:01 pm, Studio LFP <studi...@gmail.com> wrote: 
> > It looks like you are starting Activity B with startActivityForResult. 
> Are 
> > you trying to receive some information back into Activity A from Activity 
> B? 
> > 
> > If not, you just want to use startActivity instead. 
> > 
> > Steven 
> > Studio LFPhttp://www.studio-lfp.com 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > On Saturday, October 22, 2011 9:36:10 AM UTC-5, ndiiie90 wrote: 
> > 
> > > Hi guys, 
> > 
> > > i implement facebook sdk in my app and just follow the tutorial. 
> > > When i call other activity, let's say: 
> > > the activity that i implement facebook sdk is activity A, from there i 
> can 
> > > call other activity which is B. 
> > > From B, i press back button, then it goes back to A. But it returns 
> error: 
> > 
> > > 
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>  
>
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538): FATAL EXCEPTION: main 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538): 
> java.lang.RuntimeException: 
> > > Failure delivering result ResultInfo{who=null, request=0, result=0, 
> > > data=null} to activity {pt.bm.vv/test.test.Test}: 
> > > java.lang.NullPointerException 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > android.app.ActivityThread.deliverResults(ActivityThread.java:3515) 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > android.app.ActivityThread.handleSendResult(ActivityThread.java:3557) 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > android.app.ActivityThread.access$2800(ActivityThread.java:125) 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > android.app.ActivityThread$H.handleMessage(ActivityThread.java:2063) 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > android.os.Handler.dispatchMessage(Handler.java:99) 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > android.os.Looper.loop(Looper.java:123) 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > android.app.ActivityThread.main(ActivityThread.java:4627) 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > java.lang.reflect.Method.invokeNative(Native Method) 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > java.lang.reflect.Method.invoke(Method.java:521) 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > 
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
>  
>
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > dalvik.system.NativeStart.main(Native Method) 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538): Caused by: 
> > > java.lang.NullPointerException 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > test.test.Test.onActivityResult(Test.java:507) 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > android.app.Activity.dispatchActivityResult(Activity.java:3890) 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     at 
> > > android.app.ActivityThread.deliverResults(ActivityThread.java:3511) 
> > > 10-22 21:33:23.445: ERROR/AndroidRuntime(538):     ... 11 more 
> > 
> > > 
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>  
>
> > 
> > > Anyone has idea to solve this problem? 
> > 
> > > Thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to