Re: [android-developers] Update UI

2012-09-21 Thread Rahul Kaushik
Hi,

Can you please elobrate

Thanks
RK

On Wed, Sep 19, 2012 at 11:37 AM, tarun sablok wrote:

> In that case your intent will be delivered  to the activity in
> onNewIntent()  so implement that and extract the extra data which you
> have send it through the getIntent()  method ...
>
> Hope this helps 
>
> Tarun
>
>
> On Tue, Sep 18, 2012 at 2:52 PM, Rahul Kaushik 
> wrote:
>
>> Intent startActivity = new Intent();
>> startActivity.setClass(context, showrReminder.class);
>>  startActivity.setAction(showrReminder.class.getName());
>>  startActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|
>> Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
>> context.startActivity(startActivity);
>>
>>
>> above is the code
>>  Thanks
>> RK
>>
>> On Tue, Sep 18, 2012 at 2:52 PM, Rahul Kaushik 
>> wrote:
>>
>>> no i am not using db, am using web services
>>> Thanks
>>> RK
>>>
>>>
>>>
>>> On Mon, Sep 17, 2012 at 4:46 PM, Felipe Silveira wrote:
>>>
 Does your broadcast receiver store data in DB? If yes, your work would
 be simple: The activity can be notified about db changes, if it have a
 cursor loading the data.

 On Mon, Sep 17, 2012 at 7:48 AM, Rahul Kaushik <
 rahulkaushi...@gmail.com> wrote:

> Hi,
>
> I have a BroadcastReceiver that's able to start an activity just fine
> from its onReceive method. But what if the activity is already
> running? How do I let it know that the BroadcastReceiver has some
> more data for it? Do I just start the activity again? If so, would
> that be a new instance of the activity? What happens to the old one?
> If it doesn't create a new instance, does onCreate get called again?
> If not, how does the activity know that it's been hit again by the
> BroadcastReceiver? More importantly, in that case, how does the
> activity get the data I attached to the intent in the
> BroadcastReceiver?
>
> I have an listview in activity to update.
>
> Thanks
> RK
>
> --
> 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




 --
 Felipe Silveira
 http://www.felipesilveira.com.br
 -

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

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

Re: [android-developers] Update UI

2012-09-18 Thread tarun sablok
In that case your intent will be delivered  to the activity in
onNewIntent()  so implement that and extract the extra data which you
have send it through the getIntent()  method ...

Hope this helps 

Tarun

On Tue, Sep 18, 2012 at 2:52 PM, Rahul Kaushik wrote:

> Intent startActivity = new Intent();
> startActivity.setClass(context, showrReminder.class);
> startActivity.setAction(showrReminder.class.getName());
>  startActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|
> Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
> context.startActivity(startActivity);
>
>
> above is the code
>  Thanks
> RK
>
> On Tue, Sep 18, 2012 at 2:52 PM, Rahul Kaushik 
> wrote:
>
>> no i am not using db, am using web services
>> Thanks
>> RK
>>
>>
>>
>> On Mon, Sep 17, 2012 at 4:46 PM, Felipe Silveira wrote:
>>
>>> Does your broadcast receiver store data in DB? If yes, your work would
>>> be simple: The activity can be notified about db changes, if it have a
>>> cursor loading the data.
>>>
>>> On Mon, Sep 17, 2012 at 7:48 AM, Rahul Kaushik >> > wrote:
>>>
 Hi,

 I have a BroadcastReceiver that's able to start an activity just fine
 from its onReceive method. But what if the activity is already
 running? How do I let it know that the BroadcastReceiver has some
 more data for it? Do I just start the activity again? If so, would
 that be a new instance of the activity? What happens to the old one?
 If it doesn't create a new instance, does onCreate get called again?
 If not, how does the activity know that it's been hit again by the
 BroadcastReceiver? More importantly, in that case, how does the
 activity get the data I attached to the intent in the
 BroadcastReceiver?

 I have an listview in activity to update.

 Thanks
 RK

 --
 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
>>>
>>>
>>>
>>>
>>> --
>>> Felipe Silveira
>>> http://www.felipesilveira.com.br
>>> -
>>>
>>> --
>>> 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
>>
>>
>>
>  --
> 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
>

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

Re: [android-developers] Update UI

2012-09-18 Thread Rahul Kaushik
Intent startActivity = new Intent();
startActivity.setClass(context, showrReminder.class);
startActivity.setAction(showrReminder.class.getName());
startActivity.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK|
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
context.startActivity(startActivity);


above is the code
 Thanks
RK

On Tue, Sep 18, 2012 at 2:52 PM, Rahul Kaushik wrote:

> no i am not using db, am using web services
> Thanks
> RK
>
>
>
> On Mon, Sep 17, 2012 at 4:46 PM, Felipe Silveira wrote:
>
>> Does your broadcast receiver store data in DB? If yes, your work would be
>> simple: The activity can be notified about db changes, if it have a cursor
>> loading the data.
>>
>> On Mon, Sep 17, 2012 at 7:48 AM, Rahul Kaushik 
>> wrote:
>>
>>> Hi,
>>>
>>> I have a BroadcastReceiver that's able to start an activity just fine
>>> from its onReceive method. But what if the activity is already
>>> running? How do I let it know that the BroadcastReceiver has some
>>> more data for it? Do I just start the activity again? If so, would
>>> that be a new instance of the activity? What happens to the old one?
>>> If it doesn't create a new instance, does onCreate get called again?
>>> If not, how does the activity know that it's been hit again by the
>>> BroadcastReceiver? More importantly, in that case, how does the
>>> activity get the data I attached to the intent in the
>>> BroadcastReceiver?
>>>
>>> I have an listview in activity to update.
>>>
>>> Thanks
>>> RK
>>>
>>> --
>>> 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
>>
>>
>>
>>
>> --
>> Felipe Silveira
>> http://www.felipesilveira.com.br
>> -
>>
>> --
>> 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
>
>
>

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

Re: [android-developers] Update UI

2012-09-18 Thread Rahul Kaushik
no i am not using db, am using web services
Thanks
RK


On Mon, Sep 17, 2012 at 4:46 PM, Felipe Silveira wrote:

> Does your broadcast receiver store data in DB? If yes, your work would be
> simple: The activity can be notified about db changes, if it have a cursor
> loading the data.
>
> On Mon, Sep 17, 2012 at 7:48 AM, Rahul Kaushik 
> wrote:
>
>> Hi,
>>
>> I have a BroadcastReceiver that's able to start an activity just fine
>> from its onReceive method. But what if the activity is already
>> running? How do I let it know that the BroadcastReceiver has some
>> more data for it? Do I just start the activity again? If so, would
>> that be a new instance of the activity? What happens to the old one?
>> If it doesn't create a new instance, does onCreate get called again?
>> If not, how does the activity know that it's been hit again by the
>> BroadcastReceiver? More importantly, in that case, how does the
>> activity get the data I attached to the intent in the
>> BroadcastReceiver?
>>
>> I have an listview in activity to update.
>>
>> Thanks
>> RK
>>
>> --
>> 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
>
>
>
>
> --
> Felipe Silveira
> http://www.felipesilveira.com.br
> -
>
> --
> 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

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

Re: [android-developers] Update UI

2012-09-17 Thread Felipe Silveira
Does your broadcast receiver store data in DB? If yes, your work would be
simple: The activity can be notified about db changes, if it have a cursor
loading the data.

On Mon, Sep 17, 2012 at 7:48 AM, Rahul Kaushik wrote:

> Hi,
>
> I have a BroadcastReceiver that's able to start an activity just fine
> from its onReceive method. But what if the activity is already
> running? How do I let it know that the BroadcastReceiver has some
> more data for it? Do I just start the activity again? If so, would
> that be a new instance of the activity? What happens to the old one?
> If it doesn't create a new instance, does onCreate get called again?
> If not, how does the activity know that it's been hit again by the
> BroadcastReceiver? More importantly, in that case, how does the
> activity get the data I attached to the intent in the
> BroadcastReceiver?
>
> I have an listview in activity to update.
>
> Thanks
> RK
>
> --
> 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




-- 
Felipe Silveira
http://www.felipesilveira.com.br
-

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

Re: [android-developers] Update UI from Service

2011-08-31 Thread Chirag Raval
Thanks Mark Murphy 

On Wed, Aug 31, 2011 at 3:05 PM, Mark Murphy wrote:

> On Wed, Aug 31, 2011 at 5:05 AM, Chirag Raval
>  wrote:
> > Can any one help me to update UI from Service ?
> >
> > Here in my application i created one service, from my service i want
> > to update a textview which is in my Main Activity ?
> >
> > How can i change that textview's value from my service ?
>
> You send a message from the service to the activity, and the activity
> updates the TextView. Whether you do this via binding and the listener
> pattern, or ordered broadcasts
> (
> http://commonsware.com/blog/2010/08/11/activity-notification-ordered-broadcast.html
> ),
> or a Messenger object passed as an Intent extra, or a PendingIntent
> from createPendingResult(), or something else, is up to you and would
> depend a bit on the service in question.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Warescription: Three Android Books, Plus Updates, One Low Price!
>
> --
> 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
>

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

Re: [android-developers] Update UI from Service

2011-08-31 Thread Mark Murphy
On Wed, Aug 31, 2011 at 5:05 AM, Chirag Raval
 wrote:
> Can any one help me to update UI from Service ?
>
> Here in my application i created one service, from my service i want
> to update a textview which is in my Main Activity ?
>
> How can i change that textview's value from my service ?

You send a message from the service to the activity, and the activity
updates the TextView. Whether you do this via binding and the listener
pattern, or ordered broadcasts
(http://commonsware.com/blog/2010/08/11/activity-notification-ordered-broadcast.html),
or a Messenger object passed as an Intent extra, or a PendingIntent
from createPendingResult(), or something else, is up to you and would
depend a bit on the service in question.

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

Warescription: Three Android Books, Plus Updates, One Low Price!

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