[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-25 Thread Amardeep Jaiman
I think you can make a service  which will be running in background all the
time and it can force your activity to come in background whenevr required
without using notification.



UNTOUCHABILITY IS SIN SO KEEP IN TOUCH


On Wed, Oct 21, 2009 at 12:46 AM, pink 444 pnk...@gmail.com wrote:



 First of all thanks for your wonderful cooperation.

 On android mobile if at all we get an incoming call while
 interacting with another application, incoming call indication is
 being displayed on the screen with an activity instead of notifying
 user with notification.

 I think it is against to android development rules.But we can't
 notify user with notification in this particular situation.




 On Oct 20, 4:28 pm, Bartosz Lambach bartosz.lamb...@gmail.com wrote:
  Please, read this article before you do that:
 http://developer.android.com/guide/practices/design/seamlessness.html
 
  Regards,
  Bartosz
 
  On Tue, Oct 20, 2009 at 1:17 PM, pink 444 pnk...@gmail.com wrote:
 
  Thanks for your replay.
 
  But the thing here is if at all we click on the notification only
   intent will bring the Activity up.
 
  I want to bring the activity to foreground without clicking any
   thing.For that what can i do.
 
  Can i bring the activity to foreground using notifications without
   clicking any button or do i need to use any other concept?
 
   On Oct 20, 3:31 pm, Nithin nithin.war...@gmail.com wrote:
   Hi Shiva,
 
   try this, may help...
 
   whichever activity, that you want to put in the foreground, use an
   Intent, by setting this flag...
 
   intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
 
   Thanks
   Nithin
 
   On Oct 20, 3:20 pm, pink 444 pnk...@gmail.com wrote:
 
   What i want to implement is i have a service which will wait on a
socket for network events.
On some network events service has to notify the application
 activity
to update GUI elements.
 
   If at all my activity is not running how can i update GUI.At any
 i
have to update GUI as soon as  network events occurred.
 
On Oct 20, 2:54 pm, RichardC richard.crit...@googlemail.com
 wrote:
 
 I have had a quick look and can't see anyway to do what you want
 (there might be a way I just can't find it).
 
 One of the reasons if I read about (on other platforms) for NOT
 implementing bring my app to the front and make it active right
 now
 is that it soon degenerates into application wars, with multiple
 application each trying to be the top-most application. In this
 situation no one wins and the end-user typically uninstalls both
 apps.
 
 Another way to think about this is - should the end-user be
 interrupted right now?  What if they are doing something more
 importent than your application such as trying to phone the
 emergency
 services.
 
 --
 RichardC
 
 On Oct 20, 10:39 am, pink 444 pnk...@gmail.com wrote:
 
  After studying some articles regarding notifications .I have
  understood something that after clicking on the notification
 only
  specified activities are activated or brought into foreground.
 
  But in my application i have to bring an activity as soon as
 a
  background event occurred.
 
  How can i implement that scenario using Notifications ?
 
  Thanks,
  -Siva.
 
  On Oct 20, 1:24 pm, pink 444 pnk...@gmail.com wrote:
 
Thanks for your replay.
 
Can u give me a working example for letting an
 activity to
   foreground using notifications.
 
   On Oct 19, 6:17 pm, RichardC richard.crit...@googlemail.com
 wrote:
 
Notificationhttp://
 developer.android.com/reference/android/app/Notification.html
 
--
RichardC
 
On Oct 19, 1:57 pm, pink 444 pnk...@gmail.com wrote:
 
 Hai,
 
In my application i wait on socket for network
 events.On some
 events i have to bring activity into foreground(make
 activity as
 running) if at all it is not in the foreground.
 
   How can i do this?
 
  Any suggestions would be appreciated highly.
 
 Thanks,
  -Siva
 


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



[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-20 Thread pink 444


 Thanks for your replay.


 Can u give me a working example for letting an activity to
foreground using notifications.




On Oct 19, 6:17 pm, RichardC richard.crit...@googlemail.com wrote:
 Notificationhttp://developer.android.com/reference/android/app/Notification.html

 --
 RichardC

 On Oct 19, 1:57 pm, pink 444 pnk...@gmail.com wrote:

  Hai,

 In my application i wait on socket for network events.On some
  events i have to bring activity into foreground(make activity as
  running) if at all it is not in the foreground.

How can i do this?

   Any suggestions would be appreciated highly.

  Thanks,
   -Siva
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-20 Thread pink 444



After studying some articles regarding notifications .I have
understood something that after clicking on the notification only
specified activities are activated or brought into foreground.

But in my application i have to bring an activity as soon as a
background event occurred.

How can i implement that scenario using Notifications ?

Thanks,
-Siva.



On Oct 20, 1:24 pm, pink 444 pnk...@gmail.com wrote:
  Thanks for your replay.

  Can u give me a working example for letting an activity to
 foreground using notifications.

 On Oct 19, 6:17 pm, RichardC richard.crit...@googlemail.com wrote:

  Notificationhttp://developer.android.com/reference/android/app/Notification.html

  --
  RichardC

  On Oct 19, 1:57 pm, pink 444 pnk...@gmail.com wrote:

   Hai,

  In my application i wait on socket for network events.On some
   events i have to bring activity into foreground(make activity as
   running) if at all it is not in the foreground.

 How can i do this?

Any suggestions would be appreciated highly.

   Thanks,
-Siva
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-20 Thread RichardC

I have had a quick look and can't see anyway to do what you want
(there might be a way I just can't find it).

One of the reasons if I read about (on other platforms) for NOT
implementing bring my app to the front and make it active right now
is that it soon degenerates into application wars, with multiple
application each trying to be the top-most application. In this
situation no one wins and the end-user typically uninstalls both apps.

Another way to think about this is - should the end-user be
interrupted right now?  What if they are doing something more
importent than your application such as trying to phone the emergency
services.

--
RichardC

On Oct 20, 10:39 am, pink 444 pnk...@gmail.com wrote:
     After studying some articles regarding notifications .I have
 understood something that after clicking on the notification only
 specified activities are activated or brought into foreground.

     But in my application i have to bring an activity as soon as a
 background event occurred.

     How can i implement that scenario using Notifications ?

 Thanks,
 -Siva.

 On Oct 20, 1:24 pm, pink 444 pnk...@gmail.com wrote:

           Thanks for your replay.

           Can u give me a working example for letting an activity to
  foreground using notifications.

  On Oct 19, 6:17 pm, RichardC richard.crit...@googlemail.com wrote:

   Notificationhttp://developer.android.com/reference/android/app/Notification.html

   --
   RichardC

   On Oct 19, 1:57 pm, pink 444 pnk...@gmail.com wrote:

Hai,

       In my application i wait on socket for network events.On some
events i have to bring activity into foreground(make activity as
running) if at all it is not in the foreground.

      How can i do this?

     Any suggestions would be appreciated highly.

Thanks,
 -Siva


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



[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-20 Thread pink 444


   What i want to implement is i have a service which will wait on a
socket for network events.
On some network events service has to notify the application activity
to update GUI elements.

   If at all my activity is not running how can i update GUI.At any i
have to update GUI as soon as  network events occurred.




On Oct 20, 2:54 pm, RichardC richard.crit...@googlemail.com wrote:
 I have had a quick look and can't see anyway to do what you want
 (there might be a way I just can't find it).

 One of the reasons if I read about (on other platforms) for NOT
 implementing bring my app to the front and make it active right now
 is that it soon degenerates into application wars, with multiple
 application each trying to be the top-most application. In this
 situation no one wins and the end-user typically uninstalls both apps.

 Another way to think about this is - should the end-user be
 interrupted right now?  What if they are doing something more
 importent than your application such as trying to phone the emergency
 services.

 --
 RichardC

 On Oct 20, 10:39 am, pink 444 pnk...@gmail.com wrote:

  After studying some articles regarding notifications .I have
  understood something that after clicking on the notification only
  specified activities are activated or brought into foreground.

  But in my application i have to bring an activity as soon as a
  background event occurred.

  How can i implement that scenario using Notifications ?

  Thanks,
  -Siva.

  On Oct 20, 1:24 pm, pink 444 pnk...@gmail.com wrote:

Thanks for your replay.

Can u give me a working example for letting an activity to
   foreground using notifications.

   On Oct 19, 6:17 pm, RichardC richard.crit...@googlemail.com wrote:

Notificationhttp://developer.android.com/reference/android/app/Notification.html

--
RichardC

On Oct 19, 1:57 pm, pink 444 pnk...@gmail.com wrote:

 Hai,

In my application i wait on socket for network events.On some
 events i have to bring activity into foreground(make activity as
 running) if at all it is not in the foreground.

   How can i do this?

  Any suggestions would be appreciated highly.

 Thanks,
  -Siva
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-20 Thread Nithin

Hi Shiva,

try this, may help...

whichever activity, that you want to put in the foreground, use an
Intent, by setting this flag...

intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);

Thanks
Nithin



On Oct 20, 3:20 pm, pink 444 pnk...@gmail.com wrote:
    What i want to implement is i have a service which will wait on a
 socket for network events.
 On some network events service has to notify the application activity
 to update GUI elements.

    If at all my activity is not running how can i update GUI.At any i
 have to update GUI as soon as  network events occurred.

 On Oct 20, 2:54 pm, RichardC richard.crit...@googlemail.com wrote:

  I have had a quick look and can't see anyway to do what you want
  (there might be a way I just can't find it).

  One of the reasons if I read about (on other platforms) for NOT
  implementing bring my app to the front and make it active right now
  is that it soon degenerates into application wars, with multiple
  application each trying to be the top-most application. In this
  situation no one wins and the end-user typically uninstalls both apps.

  Another way to think about this is - should the end-user be
  interrupted right now?  What if they are doing something more
  importent than your application such as trying to phone the emergency
  services.

  --
  RichardC

  On Oct 20, 10:39 am, pink 444 pnk...@gmail.com wrote:

       After studying some articles regarding notifications .I have
   understood something that after clicking on the notification only
   specified activities are activated or brought into foreground.

       But in my application i have to bring an activity as soon as a
   background event occurred.

       How can i implement that scenario using Notifications ?

   Thanks,
   -Siva.

   On Oct 20, 1:24 pm, pink 444 pnk...@gmail.com wrote:

         Thanks for your replay.

         Can u give me a working example for letting an activity to
foreground using notifications.

On Oct 19, 6:17 pm, RichardC richard.crit...@googlemail.com wrote:

 Notificationhttp://developer.android.com/reference/android/app/Notification.html

 --
 RichardC

 On Oct 19, 1:57 pm, pink 444 pnk...@gmail.com wrote:

  Hai,

         In my application i wait on socket for network events.On some
  events i have to bring activity into foreground(make activity as
  running) if at all it is not in the foreground.

        How can i do this?

       Any suggestions would be appreciated highly.

  Thanks,
   -Siva


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



[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-20 Thread pink 444


Thanks for your replay.

But the thing here is if at all we click on the notification only
intent will bring the Activity up.

I want to bring the activity to foreground without clicking any
thing.For that what can i do.

Can i bring the activity to foreground using notifications without
clicking any button or do i need to use any other concept?





On Oct 20, 3:31 pm, Nithin nithin.war...@gmail.com wrote:
 Hi Shiva,

 try this, may help...

 whichever activity, that you want to put in the foreground, use an
 Intent, by setting this flag...

 intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);

 Thanks
 Nithin

 On Oct 20, 3:20 pm, pink 444 pnk...@gmail.com wrote:

 What i want to implement is i have a service which will wait on a
  socket for network events.
  On some network events service has to notify the application activity
  to update GUI elements.

 If at all my activity is not running how can i update GUI.At any i
  have to update GUI as soon as  network events occurred.

  On Oct 20, 2:54 pm, RichardC richard.crit...@googlemail.com wrote:

   I have had a quick look and can't see anyway to do what you want
   (there might be a way I just can't find it).

   One of the reasons if I read about (on other platforms) for NOT
   implementing bring my app to the front and make it active right now
   is that it soon degenerates into application wars, with multiple
   application each trying to be the top-most application. In this
   situation no one wins and the end-user typically uninstalls both apps.

   Another way to think about this is - should the end-user be
   interrupted right now?  What if they are doing something more
   importent than your application such as trying to phone the emergency
   services.

   --
   RichardC

   On Oct 20, 10:39 am, pink 444 pnk...@gmail.com wrote:

After studying some articles regarding notifications .I have
understood something that after clicking on the notification only
specified activities are activated or brought into foreground.

But in my application i have to bring an activity as soon as a
background event occurred.

How can i implement that scenario using Notifications ?

Thanks,
-Siva.

On Oct 20, 1:24 pm, pink 444 pnk...@gmail.com wrote:

  Thanks for your replay.

  Can u give me a working example for letting an activity to
 foreground using notifications.

 On Oct 19, 6:17 pm, RichardC richard.crit...@googlemail.com wrote:

  Notificationhttp://developer.android.com/reference/android/app/Notification.html

  --
  RichardC

  On Oct 19, 1:57 pm, pink 444 pnk...@gmail.com wrote:

   Hai,

  In my application i wait on socket for network events.On 
   some
   events i have to bring activity into foreground(make activity as
   running) if at all it is not in the foreground.

 How can i do this?

Any suggestions would be appreciated highly.

   Thanks,
-Siva
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-20 Thread String

Reread RichardC's reply. There's good reason to believe that the
platform doesn't allow - indeed shouldn't allow - arbitrary apps to
bring their activities to the foreground without user action.

Even if the platform does allow it, I have to agree with RichardC that
it's not a good idea. If the user has moved on from your activity to
another, why do you know better than they that yours is more
important?

I suggest you rethink your architecture to achieve your desired result
without using this technique. For example:
- update a database from a background service when the network action
of interest occurs
- update your activity's GUI from the database the next time the USER
brings it to the foreground

String

On Oct 20, 12:17 pm, pink 444 pnk...@gmail.com wrote:
     Thanks for your replay.

     But the thing here is if at all we click on the notification only
 intent will bring the Activity up.

     I want to bring the activity to foreground without clicking any
 thing.For that what can i do.

     Can i bring the activity to foreground using notifications without
 clicking any button or do i need to use any other concept?

 On Oct 20, 3:31 pm, Nithin nithin.war...@gmail.com wrote:



  Hi Shiva,

  try this, may help...

  whichever activity, that you want to put in the foreground, use an
  Intent, by setting this flag...

  intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);

  Thanks
  Nithin

  On Oct 20, 3:20 pm, pink 444 pnk...@gmail.com wrote:

      What i want to implement is i have a service which will wait on a
   socket for network events.
   On some network events service has to notify the application activity
   to update GUI elements.

      If at all my activity is not running how can i update GUI.At any i
   have to update GUI as soon as  network events occurred.

   On Oct 20, 2:54 pm, RichardC richard.crit...@googlemail.com wrote:

I have had a quick look and can't see anyway to do what you want
(there might be a way I just can't find it).

One of the reasons if I read about (on other platforms) for NOT
implementing bring my app to the front and make it active right now
is that it soon degenerates into application wars, with multiple
application each trying to be the top-most application. In this
situation no one wins and the end-user typically uninstalls both apps.

Another way to think about this is - should the end-user be
interrupted right now?  What if they are doing something more
importent than your application such as trying to phone the emergency
services.

--
RichardC

On Oct 20, 10:39 am, pink 444 pnk...@gmail.com wrote:

     After studying some articles regarding notifications .I have
 understood something that after clicking on the notification only
 specified activities are activated or brought into foreground.

     But in my application i have to bring an activity as soon as a
 background event occurred.

     How can i implement that scenario using Notifications ?

 Thanks,
 -Siva.

 On Oct 20, 1:24 pm, pink 444 pnk...@gmail.com wrote:

           Thanks for your replay.

           Can u give me a working example for letting an activity to
  foreground using notifications.

  On Oct 19, 6:17 pm, RichardC richard.crit...@googlemail.com wrote:

   Notificationhttp://developer.android.com/reference/android/app/Notification.html

   --
   RichardC

   On Oct 19, 1:57 pm, pink 444 pnk...@gmail.com wrote:

Hai,

       In my application i wait on socket for network events.On 
some
events i have to bring activity into foreground(make activity as
running) if at all it is not in the foreground.

      How can i do this?

     Any suggestions would be appreciated highly.

Thanks,
 -Siva
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-20 Thread Agus
use a service to capture that network events.

On Mon, Oct 19, 2009 at 5:57 AM, pink 444 pnk...@gmail.com wrote:


 Hai,

   In my application i wait on socket for network events.On some
 events i have to bring activity into foreground(make activity as
 running) if at all it is not in the foreground.


  How can i do this?

 Any suggestions would be appreciated highly.


 Thanks,
  -Siva


 


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



[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-20 Thread pink 444



 Even if the platform does allow it, I have to agree with RichardC that
 it's not a good idea. If the user has moved on from your activity to
 another, why do you know better than they that yours is more
 important?

   As soon as i receive network event can i create a new activity and
destroy previous activity if at all it is not active.

   There should be some feasible design because android is handling
incoming call indication .I think it is also handling similar type of
problems.

   Please guide me in a right way.



On Oct 20, 5:49 pm, String sterling.ud...@googlemail.com wrote:
 Reread RichardC's reply. There's good reason to believe that the
 platform doesn't allow - indeed shouldn't allow - arbitrary apps to
 bring their activities to the foreground without user action.

 Even if the platform does allow it, I have to agree with RichardC that
 it's not a good idea. If the user has moved on from your activity to
 another, why do you know better than they that yours is more
 important?

 I suggest you rethink your architecture to achieve your desired result
 without using this technique. For example:
 - update a database from a background service when the network action
 of interest occurs
 - update your activity's GUI from the database the next time the USER
 brings it to the foreground

 String

 On Oct 20, 12:17 pm, pink 444 pnk...@gmail.com wrote:

  Thanks for your replay.

  But the thing here is if at all we click on the notification only
  intent will bring the Activity up.

  I want to bring the activity to foreground without clicking any
  thing.For that what can i do.

  Can i bring the activity to foreground using notifications without
  clicking any button or do i need to use any other concept?

  On Oct 20, 3:31 pm, Nithin nithin.war...@gmail.com wrote:

   Hi Shiva,

   try this, may help...

   whichever activity, that you want to put in the foreground, use an
   Intent, by setting this flag...

   intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);

   Thanks
   Nithin

   On Oct 20, 3:20 pm, pink 444 pnk...@gmail.com wrote:

   What i want to implement is i have a service which will wait on a
socket for network events.
On some network events service has to notify the application activity
to update GUI elements.

   If at all my activity is not running how can i update GUI.At any i
have to update GUI as soon as  network events occurred.

On Oct 20, 2:54 pm, RichardC richard.crit...@googlemail.com wrote:

 I have had a quick look and can't see anyway to do what you want
 (there might be a way I just can't find it).

 One of the reasons if I read about (on other platforms) for NOT
 implementing bring my app to the front and make it active right now
 is that it soon degenerates into application wars, with multiple
 application each trying to be the top-most application. In this
 situation no one wins and the end-user typically uninstalls both apps.

 Another way to think about this is - should the end-user be
 interrupted right now?  What if they are doing something more
 importent than your application such as trying to phone the emergency
 services.

 --
 RichardC

 On Oct 20, 10:39 am, pink 444 pnk...@gmail.com wrote:

  After studying some articles regarding notifications .I have
  understood something that after clicking on the notification only
  specified activities are activated or brought into foreground.

  But in my application i have to bring an activity as soon as a
  background event occurred.

  How can i implement that scenario using Notifications ?

  Thanks,
  -Siva.

  On Oct 20, 1:24 pm, pink 444 pnk...@gmail.com wrote:

Thanks for your replay.

Can u give me a working example for letting an activity 
   to
   foreground using notifications.

   On Oct 19, 6:17 pm, RichardC richard.crit...@googlemail.com 
   wrote:

Notificationhttp://developer.android.com/reference/android/app/Notification.html

--
RichardC

On Oct 19, 1:57 pm, pink 444 pnk...@gmail.com wrote:

 Hai,

In my application i wait on socket for network 
 events.On some
 events i have to bring activity into foreground(make activity 
 as
 running) if at all it is not in the foreground.

   How can i do this?

  Any suggestions would be appreciated highly.

 Thanks,
  -Siva
--~--~-~--~~~---~--~~
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

[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-20 Thread Streets Of Boston

RichardC and String are correct.

You can't and shouldn't do this. Re-design your app so that the user
does not need to push a GUI to the front at any possible given time.

Also, your background service that waits in the background may have
been killed by the Android OS due to low memory or low resource; It
may not even be running when your network-event happens

If you did manage to have your activity pop to the foreground without
any user interaction and then put your app on the market, expect quite
a few bad comments.

Why the phone-dialer can get to the foreground automatically:
It's a phone!

Even the SMS and voice-mail notifications don't automatically show a
UI. They show notifications.


On Oct 20, 9:42 am, pink 444 pnk...@gmail.com wrote:
  Even if the platform does allow it, I have to agree with RichardC that
  it's not a good idea. If the user has moved on from your activity to
  another, why do you know better than they that yours is more
  important?

    As soon as i receive network event can i create a new activity and
 destroy previous activity if at all it is not active.

    There should be some feasible design because android is handling
 incoming call indication .I think it is also handling similar type of
 problems.

    Please guide me in a right way.

 On Oct 20, 5:49 pm, String sterling.ud...@googlemail.com wrote:



  Reread RichardC's reply. There's good reason to believe that the
  platform doesn't allow - indeed shouldn't allow - arbitrary apps to
  bring their activities to the foreground without user action.

  Even if the platform does allow it, I have to agree with RichardC that
  it's not a good idea. If the user has moved on from your activity to
  another, why do you know better than they that yours is more
  important?

  I suggest you rethink your architecture to achieve your desired result
  without using this technique. For example:
  - update a database from a background service when the network action
  of interest occurs
  - update your activity's GUI from the database the next time the USER
  brings it to the foreground

  String

  On Oct 20, 12:17 pm, pink 444 pnk...@gmail.com wrote:

       Thanks for your replay.

       But the thing here is if at all we click on the notification only
   intent will bring the Activity up.

       I want to bring the activity to foreground without clicking any
   thing.For that what can i do.

       Can i bring the activity to foreground using notifications without
   clicking any button or do i need to use any other concept?

   On Oct 20, 3:31 pm, Nithin nithin.war...@gmail.com wrote:

Hi Shiva,

try this, may help...

whichever activity, that you want to put in the foreground, use an
Intent, by setting this flag...

intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);

Thanks
Nithin

On Oct 20, 3:20 pm, pink 444 pnk...@gmail.com wrote:

    What i want to implement is i have a service which will wait on a
 socket for network events.
 On some network events service has to notify the application activity
 to update GUI elements.

    If at all my activity is not running how can i update GUI.At any i
 have to update GUI as soon as  network events occurred.

 On Oct 20, 2:54 pm, RichardC richard.crit...@googlemail.com wrote:

  I have had a quick look and can't see anyway to do what you want
  (there might be a way I just can't find it).

  One of the reasons if I read about (on other platforms) for NOT
  implementing bring my app to the front and make it active right 
  now
  is that it soon degenerates into application wars, with multiple
  application each trying to be the top-most application. In this
  situation no one wins and the end-user typically uninstalls both 
  apps.

  Another way to think about this is - should the end-user be
  interrupted right now?  What if they are doing something more
  importent than your application such as trying to phone the 
  emergency
  services.

  --
  RichardC

  On Oct 20, 10:39 am, pink 444 pnk...@gmail.com wrote:

       After studying some articles regarding notifications .I have
   understood something that after clicking on the notification only
   specified activities are activated or brought into foreground.

       But in my application i have to bring an activity as soon as a
   background event occurred.

       How can i implement that scenario using Notifications ?

   Thanks,
   -Siva.

   On Oct 20, 1:24 pm, pink 444 pnk...@gmail.com wrote:

         Thanks for your replay.

         Can u give me a working example for letting an 
activity to
foreground using notifications.

On Oct 19, 6:17 pm, RichardC richard.crit...@googlemail.com 
wrote:

 Notificationhttp://developer.android.com/reference/android/app/Notification.html

 --
  

[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-20 Thread Agus
I don't understand why do you want to force to display your activity. Is
this a must for your requirement?
It would be better to display notification from a background service,
clicking the notification will forward to your activity screen.

On Tue, Oct 20, 2009 at 6:42 AM, pink 444 pnk...@gmail.com wrote:




  Even if the platform does allow it, I have to agree with RichardC that
  it's not a good idea. If the user has moved on from your activity to
  another, why do you know better than they that yours is more
  important?

As soon as i receive network event can i create a new activity and
 destroy previous activity if at all it is not active.

   There should be some feasible design because android is handling
 incoming call indication .I think it is also handling similar type of
 problems.

   Please guide me in a right way.



 On Oct 20, 5:49 pm, String sterling.ud...@googlemail.com wrote:
  Reread RichardC's reply. There's good reason to believe that the
  platform doesn't allow - indeed shouldn't allow - arbitrary apps to
  bring their activities to the foreground without user action.
 
  Even if the platform does allow it, I have to agree with RichardC that
  it's not a good idea. If the user has moved on from your activity to
  another, why do you know better than they that yours is more
  important?
 
  I suggest you rethink your architecture to achieve your desired result
  without using this technique. For example:
  - update a database from a background service when the network action
  of interest occurs
  - update your activity's GUI from the database the next time the USER
  brings it to the foreground
 
  String
 
  On Oct 20, 12:17 pm, pink 444 pnk...@gmail.com wrote:
 
   Thanks for your replay.
 
   But the thing here is if at all we click on the notification only
   intent will bring the Activity up.
 
   I want to bring the activity to foreground without clicking any
   thing.For that what can i do.
 
   Can i bring the activity to foreground using notifications without
   clicking any button or do i need to use any other concept?
 
   On Oct 20, 3:31 pm, Nithin nithin.war...@gmail.com wrote:
 
Hi Shiva,
 
try this, may help...
 
whichever activity, that you want to put in the foreground, use an
Intent, by setting this flag...
 
intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
 
Thanks
Nithin
 
On Oct 20, 3:20 pm, pink 444 pnk...@gmail.com wrote:
 
What i want to implement is i have a service which will wait on
 a
 socket for network events.
 On some network events service has to notify the application
 activity
 to update GUI elements.
 
If at all my activity is not running how can i update GUI.At any
 i
 have to update GUI as soon as  network events occurred.
 
 On Oct 20, 2:54 pm, RichardC richard.crit...@googlemail.com
 wrote:
 
  I have had a quick look and can't see anyway to do what you want
  (there might be a way I just can't find it).
 
  One of the reasons if I read about (on other platforms) for NOT
  implementing bring my app to the front and make it active right
 now
  is that it soon degenerates into application wars, with multiple
  application each trying to be the top-most application. In this
  situation no one wins and the end-user typically uninstalls both
 apps.
 
  Another way to think about this is - should the end-user be
  interrupted right now?  What if they are doing something more
  importent than your application such as trying to phone the
 emergency
  services.
 
  --
  RichardC
 
  On Oct 20, 10:39 am, pink 444 pnk...@gmail.com wrote:
 
   After studying some articles regarding notifications .I
 have
   understood something that after clicking on the notification
 only
   specified activities are activated or brought into foreground.
 
   But in my application i have to bring an activity as soon
 as a
   background event occurred.
 
   How can i implement that scenario using Notifications ?
 
   Thanks,
   -Siva.
 
   On Oct 20, 1:24 pm, pink 444 pnk...@gmail.com wrote:
 
 Thanks for your replay.
 
 Can u give me a working example for letting an
 activity to
foreground using notifications.
 
On Oct 19, 6:17 pm, RichardC richard.crit...@googlemail.com
 wrote:
 
 Notificationhttp://
 developer.android.com/reference/android/app/Notification.html
 
 --
 RichardC
 
 On Oct 19, 1:57 pm, pink 444 pnk...@gmail.com wrote:
 
  Hai,
 
 In my application i wait on socket for network
 events.On some
  events i have to bring activity into foreground(make
 activity as
  running) if at all it is not in the foreground.
 
How can i do this?
 
   Any suggestions would be appreciated highly.
 
  Thanks,
   -Siva
 

[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-20 Thread Bartosz Lambach

You cannot just bring your app into foreground. Its against android
rules. You have to use notification mechanism to inform user about an
event.

Regards,
Batosz

On Tue, Oct 20, 2009 at 10:24 AM, pink 444 pnk...@gmail.com wrote:


         Thanks for your replay.


         Can u give me a working example for letting an activity to
 foreground using notifications.




 On Oct 19, 6:17 pm, RichardC richard.crit...@googlemail.com wrote:
 Notificationhttp://developer.android.com/reference/android/app/Notification.html

 --
 RichardC

 On Oct 19, 1:57 pm, pink 444 pnk...@gmail.com wrote:

  Hai,

         In my application i wait on socket for network events.On some
  events i have to bring activity into foreground(make activity as
  running) if at all it is not in the foreground.

        How can i do this?

       Any suggestions would be appreciated highly.

  Thanks,
   -Siva
 


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



[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-20 Thread Bartosz Lambach

Please, read this article before you do that:
http://developer.android.com/guide/practices/design/seamlessness.html

Regards,
Bartosz


On Tue, Oct 20, 2009 at 1:17 PM, pink 444 pnk...@gmail.com wrote:


    Thanks for your replay.

    But the thing here is if at all we click on the notification only
 intent will bring the Activity up.

    I want to bring the activity to foreground without clicking any
 thing.For that what can i do.

    Can i bring the activity to foreground using notifications without
 clicking any button or do i need to use any other concept?





 On Oct 20, 3:31 pm, Nithin nithin.war...@gmail.com wrote:
 Hi Shiva,

 try this, may help...

 whichever activity, that you want to put in the foreground, use an
 Intent, by setting this flag...

 intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);

 Thanks
 Nithin

 On Oct 20, 3:20 pm, pink 444 pnk...@gmail.com wrote:

     What i want to implement is i have a service which will wait on a
  socket for network events.
  On some network events service has to notify the application activity
  to update GUI elements.

     If at all my activity is not running how can i update GUI.At any i
  have to update GUI as soon as  network events occurred.

  On Oct 20, 2:54 pm, RichardC richard.crit...@googlemail.com wrote:

   I have had a quick look and can't see anyway to do what you want
   (there might be a way I just can't find it).

   One of the reasons if I read about (on other platforms) for NOT
   implementing bring my app to the front and make it active right now
   is that it soon degenerates into application wars, with multiple
   application each trying to be the top-most application. In this
   situation no one wins and the end-user typically uninstalls both apps.

   Another way to think about this is - should the end-user be
   interrupted right now?  What if they are doing something more
   importent than your application such as trying to phone the emergency
   services.

   --
   RichardC

   On Oct 20, 10:39 am, pink 444 pnk...@gmail.com wrote:

    After studying some articles regarding notifications .I have
understood something that after clicking on the notification only
specified activities are activated or brought into foreground.

    But in my application i have to bring an activity as soon as a
background event occurred.

    How can i implement that scenario using Notifications ?

Thanks,
-Siva.

On Oct 20, 1:24 pm, pink 444 pnk...@gmail.com wrote:

          Thanks for your replay.

          Can u give me a working example for letting an activity to
 foreground using notifications.

 On Oct 19, 6:17 pm, RichardC richard.crit...@googlemail.com wrote:

  Notificationhttp://developer.android.com/reference/android/app/Notification.html

  --
  RichardC

  On Oct 19, 1:57 pm, pink 444 pnk...@gmail.com wrote:

   Hai,

          In my application i wait on socket for network events.On 
   some
   events i have to bring activity into foreground(make activity as
   running) if at all it is not in the foreground.

         How can i do this?

        Any suggestions would be appreciated highly.

   Thanks,
    -Siva
 


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



[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-20 Thread pink 444


 First of all thanks for your wonderful cooperation.

 On android mobile if at all we get an incoming call while
interacting with another application, incoming call indication is
being displayed on the screen with an activity instead of notifying
user with notification.

 I think it is against to android development rules.But we can't
notify user with notification in this particular situation.




On Oct 20, 4:28 pm, Bartosz Lambach bartosz.lamb...@gmail.com wrote:
 Please, read this article before you do 
 that:http://developer.android.com/guide/practices/design/seamlessness.html

 Regards,
 Bartosz

 On Tue, Oct 20, 2009 at 1:17 PM, pink 444 pnk...@gmail.com wrote:

 Thanks for your replay.

 But the thing here is if at all we click on the notification only
  intent will bring the Activity up.

 I want to bring the activity to foreground without clicking any
  thing.For that what can i do.

 Can i bring the activity to foreground using notifications without
  clicking any button or do i need to use any other concept?

  On Oct 20, 3:31 pm, Nithin nithin.war...@gmail.com wrote:
  Hi Shiva,

  try this, may help...

  whichever activity, that you want to put in the foreground, use an
  Intent, by setting this flag...

  intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);

  Thanks
  Nithin

  On Oct 20, 3:20 pm, pink 444 pnk...@gmail.com wrote:

  What i want to implement is i have a service which will wait on a
   socket for network events.
   On some network events service has to notify the application activity
   to update GUI elements.

  If at all my activity is not running how can i update GUI.At any i
   have to update GUI as soon as  network events occurred.

   On Oct 20, 2:54 pm, RichardC richard.crit...@googlemail.com wrote:

I have had a quick look and can't see anyway to do what you want
(there might be a way I just can't find it).

One of the reasons if I read about (on other platforms) for NOT
implementing bring my app to the front and make it active right now
is that it soon degenerates into application wars, with multiple
application each trying to be the top-most application. In this
situation no one wins and the end-user typically uninstalls both apps.

Another way to think about this is - should the end-user be
interrupted right now?  What if they are doing something more
importent than your application such as trying to phone the emergency
services.

--
RichardC

On Oct 20, 10:39 am, pink 444 pnk...@gmail.com wrote:

 After studying some articles regarding notifications .I have
 understood something that after clicking on the notification only
 specified activities are activated or brought into foreground.

 But in my application i have to bring an activity as soon as a
 background event occurred.

 How can i implement that scenario using Notifications ?

 Thanks,
 -Siva.

 On Oct 20, 1:24 pm, pink 444 pnk...@gmail.com wrote:

   Thanks for your replay.

   Can u give me a working example for letting an activity to
  foreground using notifications.

  On Oct 19, 6:17 pm, RichardC richard.crit...@googlemail.com 
  wrote:

   Notificationhttp://developer.android.com/reference/android/app/Notification.html

   --
   RichardC

   On Oct 19, 1:57 pm, pink 444 pnk...@gmail.com wrote:

Hai,

   In my application i wait on socket for network 
events.On some
events i have to bring activity into foreground(make activity 
as
running) if at all it is not in the foreground.

  How can i do this?

 Any suggestions would be appreciated highly.

Thanks,
 -Siva
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[android-developers] Re: How can i bring an activity to foreground from background manually?

2009-10-19 Thread RichardC

Notification
http://developer.android.com/reference/android/app/Notification.html

--
RichardC

On Oct 19, 1:57 pm, pink 444 pnk...@gmail.com wrote:
 Hai,

        In my application i wait on socket for network events.On some
 events i have to bring activity into foreground(make activity as
 running) if at all it is not in the foreground.

       How can i do this?

      Any suggestions would be appreciated highly.

 Thanks,
  -Siva
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---