In order to transfer a value from one activity you can use Extras.

In your activity....

                /* Create an Intent that will start the next Activity */
                Intent intent = new
Intent(MyActivity.this,NextActivty.class);
                intent.putExtra("com.your.package.PEOPLE_ID", peopleId);
                MyActivity.this.startActivity(intent);

In your next activity in the onCreate()...

        Bundle extras = getIntent().getExtras();
        peopleId= extras.getInt("com.your.package.PEOPLE_ID", 0);

hope this helps...

On Tue, Apr 6, 2010 at 11:03 PM, Nubh <[email protected]> wrote:

> Need to store values here and pass to other activity, this is the
> actual code where we need to store the values to the phone no 1,
> please help.. Here I am printing a toast on the screen but what i need
> to do the contact I select from the list i.e. "parent.getContext()"
> method is calling People._Id which captures the ID of the phonebook
> entry and which is needed to import the values in the list, so my
> motive is to store the number and pass it to the dialer or
> 'ACTION_CALL'.
> I made that code so I need to know how an activity transfers the value
> from one activity to another when both the activities are
> subactivities.
>
> Thanks
> NUBH
>
>
> // This is method for first spinner
>        public class MyOnItemSelectedListener implements
> OnItemSelectedListener
>                {
>                public void onItemSelected(AdapterView<?> parent,
>                        View view, int pos, long id)
>                {
>                //
>                Toast.makeText(parent.getContext(),
>                "The Person is " +
>                parent.getItemAtPosition(pos).toString(),
>                Toast.LENGTH_LONG).show();
>                        }
>                        public void onNothingSelected(AdapterView<?> parent)
>                        {
>                                // Do nothing.
>                        }
>                }
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
> To unsubscribe, reply using "remove me" as the subject.
>

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

Reply via email to