Instead of directly put the strings into putextra, I use bundle to
wrap
things up.

In IntentA,
         Intent i1 = new Intent(this,IntentB.class);
         Bundle bundle = new Bundle();
         bundle.putString("Intent Name", "IntentA");
         i1.putExtras(bundle);
         startActivity(i1);

In IntenB,
         Bundle bundle = this.getIntent().getExtras();
         mIntentcalledme = bundle.getString("Intent Name");

You can put other things into bundle and pass them to other intent.


On May 5, 2:27 pm, "pramod.deore" <deore.pramo...@gmail.com> wrote:
> Hello everybody,
>            I had write two classes IntentA and IntentB in my
> application (Both are in same package and both extends Activity
> class). In IntentA class I had created one button on pressing that
> button controll is trsnfer to IntentB class . IntentB class also
> contain Button on pressing that control is transfer to IntentA class.
>
>           This work fines. Now I want to set value in IntentA class
> using putExtra method and access that value in IntentB class How
> should I do that? I had put value in class IntentA like
>
>         Intent i1 = new Intent(this,IntentB.class);
>         i1.putExtra("Intent Name", "IntentA");
>         startActivity(i1);
>
> Now I don't know How to access "Intent Name" value in IntentB class.
> Please help me.
> Thanks in advance
>
> --
> 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 
> athttp://groups.google.com/group/android-developers?hl=en

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