I switched the launch mode for BaseIngredientEdit to standard and
still nothing.  What am I missing?  If I got some free time tomorrow
I'm going to try to make a sandbox project with just skeleton code to
get OnActivityResult() to trigger for me to compare against.  Any
ideas in the mean time?

On Mar 23, 9:04 am, Joey Selah <josephsela...@gmail.com> wrote:
> Thanks Matt!
>
> The resultCode == 0 is nothing really, I just quickly threw it in so I
> could set a breakpoint to test that the event handler was being called
> and the breakpoint isn't hitting.  but I'll definitely be changing
> resultCode after it hits.
>
> So correct me if I'm wrong, if I set the launch mode of the intent to
> "standard" then OnActivityResult() should be hit, right?
>
> On Mar 22, 7:14 pm, mcterry <macte...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hey Joey - first off, it looks like you are testing for the resultCode == 0
> > in your onActivityResult() method.  You should be looking for whatever you
> > set your result to in your BaseIngredient Activity (looks like you're using
> > RESULT_OK).
>
> > In addition, if you've changed the "launchMode" of an Activity, then
> > there's a good chance that you will *not* get the result back.  For
> > example, singleTask will put each Activity into separate Tasks, and one
> > Activity won't ship the result back to the other Activity without some
> > additional 
> > work.http://developer.android.com/guide/topics/manifest/activity-element.h...
>
> > I hope this helps!
> > -Mattwww.sep.com/mcterry
>
> > On Thursday, March 22, 2012 10:43:24 AM UTC-4, Joey Selah wrote:
>
> > > Actually excuse me,
>
> > > I've mixed the classed up some how.  Below is the correct code:
>
> > > public class BrewJournalEdit extends Activity {
> > >     @Override
> > >     protected void onCreate(Bundle savedInstanceState) {
> > >         super.onCreate(​savedInstanceState);
> > >         setContentView(R.layout.brew_​journal_edit);
> > >         baseIngredientButton.​setOnClickListener(new
> > > View.OnClickListener() {
> > >             public void onClick(View view) {
> > >                 Intent intent = new
> > > Intent().setClass(​BrewJournalEdit.this, BaseIngredientEdit.class);
> > >                 int requestCode = 0;
> > >                 startActivityForResult(intent, requestCode);
> > >             }
> > >         });
> > >     @Override
> > >     protected void onActivityResult(int requestCode, int resultCode,
> > > Intent data)
> > >     {
> > >         if(resultCode == 0)
> > >         {
> > >         }
> > >     }
> > > }
>
> > > public class BaseIngredientEdit extends Activity {
> > >     @Override
> > >     protected void onCreate(Bundle savedInstanceState) {
> > >         super.onCreate(​savedInstanceState);
> > >         setContentView(R.layout.brew_​base_ingredients_edit);
> > >         Button confirmButton = (Button) findViewById(R.id.confirm);
> > >         confirmButton.​setOnClickListener(new View.OnClickListener() {
> > >             public void onClick(View view) {
> > >                 setResult(RESULT_OK);
> > >                 finish();
> > >             }
> > >         });
>
> > > On Mar 19, 10:21 pm, FiringCode <kims...@gmail.com> wrote:
> > > > Intent().setClass(​BrewJournalEdit.this, BaseIngredientEdit.class);
>
> > > > to
>
> > > > Intent().setClass(​BaseIngredientEdit.this, BrewJournalEdit.class);

-- 
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