Use setResult(RESULT_OK, myIntent) and get rid of the
createPendingResult() call. Also, you probably do not need the action
or the class on that Intent.

On Wed, Jul 21, 2010 at 9:21 PM, Bret Foreman <bret.fore...@gmail.com> wrote:
> I'm getting a null Intent returned from onActivityResult. A summary of
> the code is listed below. Any ideas what I might be doing wrong?
>
> Code in calling Activity:
>
>                Intent myIntent = new Intent( Intent.ACTION_VIEW );
>                myIntent.setClass(this,TheCalledActivity.class);
>                startActivityForResult( myIntent , SORT_PREFERENCES_CHANGED );
>
> Code in called Activity:
>                commitButton.setOnClickListener( new View.OnClickListener() {
>                        public void onClick(View v) {
>                                Intent myIntent = new 
> Intent(Intent.ACTION_VIEW);
>                                myIntent.setClass( v.getContext() , 
> TheCallingActivity.class );
>                                setResult(Activity.RESULT_OK);
>                                
> createPendingResult(0,myIntent,PendingIntent.FLAG_ONE_SHOT);
>                                finish();
>            }
>                });
>
>
> Code in calling Activity:
>
>       �...@override
>        protected void onActivityResult(int requestCode, int resultCode,
> Intent data) {
>                // data is coming back as null.
>        }

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to