I believe that would be correct.

As far as I can tell, the only way to determine the difference is by
checking the following:
- Bundle is null
- Bundle doesn't have the key you specified.

Again, I have not had the need to do this yet so I am only speculating.  But
this is what I understand from having read through the Dev Guide.

Thanks,
Justin

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------


On Mon, Oct 5, 2009 at 10:58 AM, Anders Feder <[email protected]>wrote:

> Aha. So I will do something like this in the BroadcastReceiver:
>
>   myIntent.putExtra("x","y");
>   myActivity.startActivity(myIntent);
>
> And then in myActivity.onCreate() do something like:
>
>   DoSomething(myBundle.getBundleExtra("x"));
>
> Does that look about right?
>
> If so, how do I tell, in onCreate(), whether the Activity was started by
> the user or by my BroadcastReceiver?
>
> Thanks a lot,
>
> Anders Feder
>
> 2009/10/5 Justin Anderson <[email protected]>
>
> Use Intent.putExtra() to add the data you want to pass to the activity you
>> are starting.  There are several different versions of putExtra depending on
>> the data you want to pass.
>>
>> Then the activity you are starting can get that information from the
>> bundle that is passed in via onCreate().
>>
>> I have never actually done this, but I believe that is how it happens...
>> If I am wrong, could somebody please correct me?
>>
>> Thanks,
>> Justin
>>
>> ----------------------------------------------------------------------
>> There are only 10 types of people in the world...
>> Those who know binary and those who don't.
>> ----------------------------------------------------------------------
>>
>>
>>
>> On Mon, Oct 5, 2009 at 9:16 AM, Anders Feder 
>> <[email protected]>wrote:
>>
>>> Thanks for your response, but could you please elaborate a bit? I don't
>>> have the lingo that straight yet. What exactly should I do? Should I add
>>> something in the AndroidManifest file? If so what, and where? Thanks again.
>>>
>>> Anders Feder
>>>
>>> 2009/10/5 <[email protected]>
>>>
>>> just add that extra bundle to intent & start new activity with this
>>>> extra.in the activity just retrive the bundle you added to it.
>>>>
>>>>
>>>> On Mon, Oct 5, 2009 at 5:12 AM, Anders Feder <[email protected]
>>>> > wrote:
>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> I'm developing an application with android.telephony.gsm that is
>>>>> supposed to process incoming SMS messages.
>>>>>
>>>>> I've figured out that I need to have a BroadcastReceiver for receiving
>>>>> the incoming messages. But how am I supposed to pass the received
>>>>> messages from the BroadcastReceiver and on to my Activity?
>>>>>
>>>>> Thanks in advance,
>>>>>
>>>>> Anders Feder
>>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to