[android-developers] Re: Handling key events in a paused Activity

2009-05-06 Thread Satya Komatineni

What about function keys? Is it possible to tie together a set of
function keys (if they exist) to a service or an activity that is in
the background?

On Tue, May 5, 2009 at 6:19 PM, Mark Murphy mmur...@commonsware.com wrote:

 Taísa Cristina wrote:
 In fact I do need to handle key strokes.

 Find another UI pattern.

 It would be easier if I could
 handle home key, so that I could prevent the user from going to home
 screen.

 Find another UI pattern. Prevent the user from going to home screen is
 fairly evil and is a tactic I would expect to find from malware.

 And it would be very boring for the user to go back to
 the Activity whenever he wanted to press a key and make stuff...

 Find another UI pattern.

 Is there a way to register for receiving key strokes if my application
 is compiled with the emulator/device image? (should I ask it on
 android-platform?)

 A list on http://source.android.com/discuss is a better place for
 questions about modifying firmware.

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

 Android App Developer Books: http://commonsware.com/books.html

 


--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-06 Thread Mark Murphy

Satya Komatineni wrote:
 What about function keys? Is it possible to tie together a set of
 function keys (if they exist) to a service or an activity that is in
 the background?

You can be notified when select dedicated hardware keys are pressed:

ACTION_CAMERA_BUTTON
ACTION_MEDIA_BUTTON

http://developer.android.com/reference/android/content/Intent.html

Bear in mind that those keys are probably being put to other uses (e.g.,
activating the camera).

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

Android App Developer Books: http://commonsware.com/books.html

--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-05 Thread ellipsoidmob...@googlemail.com

If what you want is to have a notification that the user can swipe
down and click to go back to your application, then you don't really
need to be handling key events whilst your activity is paused. What
you could do is create a service which displays the notification, and
then use an intent to launch your activity when the notification is
clicked.

BUT - I'm not sure that this is good usability design. If the user has
navigated away from your activity and if you don't need to do any
continual background processing, then you probably shouldn't show
anything in the notification panel. The user can always get back to
your app from the homescreen or via a long press on the home button.
--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-05 Thread Taísa Cristina
My application behavior is similar to voice call, but I need also to handle
key events. My application is still running in background and the activity
is paused. Is there a way to receive key events in such situation? When the
call screen is paused, it receives end call key event. Can I receive a
specific key event in a similar situation? Is there a way to register my
activity (or my application) for that?

Taísa Cristina Costa dos Santos
Computer Engineer
Brazil, SP
55 19 8152-7453


On Tue, May 5, 2009 at 8:02 AM, ellipsoidmob...@googlemail.com 
ellipsoidmob...@googlemail.com wrote:


 If what you want is to have a notification that the user can swipe
 down and click to go back to your application, then you don't really
 need to be handling key events whilst your activity is paused. What
 you could do is create a service which displays the notification, and
 then use an intent to launch your activity when the notification is
 clicked.

 BUT - I'm not sure that this is good usability design. If the user has
 navigated away from your activity and if you don't need to do any
 continual background processing, then you probably shouldn't show
 anything in the notification panel. The user can always get back to
 your app from the homescreen or via a long press on the home button.
 


--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-05 Thread Satya Komatineni

perhaps is there a way to intercept all key events globally before
they are dispatched to the apps?

On Tue, May 5, 2009 at 8:51 AM, Taísa Cristina taisa.san...@gmail.com wrote:

 My application behavior is similar to voice call, but I need also to handle
 key events. My application is still running in background and the activity
 is paused. Is there a way to receive key events in such situation? When the
 call screen is paused, it receives end call key event. Can I receive a
 specific key event in a similar situation? Is there a way to register my
 activity (or my application) for that?

 Taísa Cristina Costa dos Santos
 Computer Engineer
 Brazil, SP
 55 19 8152-7453


 On Tue, May 5, 2009 at 8:02 AM, ellipsoidmob...@googlemail.com
 ellipsoidmob...@googlemail.com wrote:

 If what you want is to have a notification that the user can swipe
 down and click to go back to your application, then you don't really
 need to be handling key events whilst your activity is paused. What
 you could do is create a service which displays the notification, and
 then use an intent to launch your activity when the notification is
 clicked.

 BUT - I'm not sure that this is good usability design. If the user has
 navigated away from your activity and if you don't need to do any
 continual background processing, then you probably shouldn't show
 anything in the notification panel. The user can always get back to
 your app from the homescreen or via a long press on the home button.



 


--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-05 Thread Marco Nelissen
When your application is paused, which activity is in the foreground?


On Tue, May 5, 2009 at 5:51 AM, Taísa Cristina taisa.san...@gmail.comwrote:


 My application behavior is similar to voice call, but I need also to handle
 key events. My application is still running in background and the activity
 is paused. Is there a way to receive key events in such situation? When the
 call screen is paused, it receives end call key event. Can I receive a
 specific key event in a similar situation? Is there a way to register my
 activity (or my application) for that?

 Taísa Cristina Costa dos Santos
 Computer Engineer
 Brazil, SP
 55 19 8152-7453


 On Tue, May 5, 2009 at 8:02 AM, ellipsoidmob...@googlemail.com 
 ellipsoidmob...@googlemail.com wrote:


 If what you want is to have a notification that the user can swipe
 down and click to go back to your application, then you don't really
 need to be handling key events whilst your activity is paused. What
 you could do is create a service which displays the notification, and
 then use an intent to launch your activity when the notification is
 clicked.

 BUT - I'm not sure that this is good usability design. If the user has
 navigated away from your activity and if you don't need to do any
 continual background processing, then you probably shouldn't show
 anything in the notification panel. The user can always get back to
 your app from the homescreen or via a long press on the home button.



 


--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-05 Thread Dianne Hackborn
No, you can't do this.  The home and end call keys are trapped by the system
before being delivered to the application, and handled by itself.

On Tue, May 5, 2009 at 5:51 AM, Taísa Cristina taisa.san...@gmail.comwrote:


 My application behavior is similar to voice call, but I need also to handle
 key events. My application is still running in background and the activity
 is paused. Is there a way to receive key events in such situation? When the
 call screen is paused, it receives end call key event. Can I receive a
 specific key event in a similar situation? Is there a way to register my
 activity (or my application) for that?

 Taísa Cristina Costa dos Santos
 Computer Engineer
 Brazil, SP
 55 19 8152-7453


 On Tue, May 5, 2009 at 8:02 AM, ellipsoidmob...@googlemail.com 
 ellipsoidmob...@googlemail.com wrote:


 If what you want is to have a notification that the user can swipe
 down and click to go back to your application, then you don't really
 need to be handling key events whilst your activity is paused. What
 you could do is create a service which displays the notification, and
 then use an intent to launch your activity when the notification is
 clicked.

 BUT - I'm not sure that this is good usability design. If the user has
 navigated away from your activity and if you don't need to do any
 continual background processing, then you probably shouldn't show
 anything in the notification panel. The user can always get back to
 your app from the homescreen or via a long press on the home button.



 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-05 Thread Taísa Cristina
I don't want to handle end call or home keys. I just want to handle another
key, such as space bar, while my Activity is in background.

Taísa Cristina Costa dos Santos
Computer Engineer
Brazil, SP
55 19 8152-7453


On Tue, May 5, 2009 at 1:45 PM, Dianne Hackborn hack...@android.com wrote:

 No, you can't do this.  The home and end call keys are trapped by the
 system before being delivered to the application, and handled by itself.

 On Tue, May 5, 2009 at 5:51 AM, Taísa Cristina taisa.san...@gmail.comwrote:


 My application behavior is similar to voice call, but I need also to
 handle key events. My application is still running in background and the
 activity is paused. Is there a way to receive key events in such situation?
 When the call screen is paused, it receives end call key event. Can I
 receive a specific key event in a similar situation? Is there a way to
 register my activity (or my application) for that?

 Taísa Cristina Costa dos Santos
 Computer Engineer
 Brazil, SP
 55 19 8152-7453


 On Tue, May 5, 2009 at 8:02 AM, ellipsoidmob...@googlemail.com 
 ellipsoidmob...@googlemail.com wrote:


 If what you want is to have a notification that the user can swipe
 down and click to go back to your application, then you don't really
 need to be handling key events whilst your activity is paused. What
 you could do is create a service which displays the notification, and
 then use an intent to launch your activity when the notification is
 clicked.

 BUT - I'm not sure that this is good usability design. If the user has
 navigated away from your activity and if you don't need to do any
 continual background processing, then you probably shouldn't show
 anything in the notification panel. The user can always get back to
 your app from the homescreen or via a long press on the home button.







 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.



 


--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-05 Thread Dianne Hackborn
You can't.

On Tue, May 5, 2009 at 9:53 AM, Taísa Cristina taisa.san...@gmail.comwrote:


 I don't want to handle end call or home keys. I just want to handle another
 key, such as space bar, while my Activity is in background.

 Taísa Cristina Costa dos Santos
 Computer Engineer
 Brazil, SP
 55 19 8152-7453


 On Tue, May 5, 2009 at 1:45 PM, Dianne Hackborn hack...@android.comwrote:

 No, you can't do this.  The home and end call keys are trapped by the
 system before being delivered to the application, and handled by itself.

 On Tue, May 5, 2009 at 5:51 AM, Taísa Cristina taisa.san...@gmail.comwrote:


 My application behavior is similar to voice call, but I need also to
 handle key events. My application is still running in background and the
 activity is paused. Is there a way to receive key events in such situation?
 When the call screen is paused, it receives end call key event. Can I
 receive a specific key event in a similar situation? Is there a way to
 register my activity (or my application) for that?

 Taísa Cristina Costa dos Santos
 Computer Engineer
 Brazil, SP
 55 19 8152-7453


 On Tue, May 5, 2009 at 8:02 AM, ellipsoidmob...@googlemail.com 
 ellipsoidmob...@googlemail.com wrote:


 If what you want is to have a notification that the user can swipe
 down and click to go back to your application, then you don't really
 need to be handling key events whilst your activity is paused. What
 you could do is create a service which displays the notification, and
 then use an intent to launch your activity when the notification is
 clicked.

 BUT - I'm not sure that this is good usability design. If the user has
 navigated away from your activity and if you don't need to do any
 continual background processing, then you probably shouldn't show
 anything in the notification panel. The user can always get back to
 your app from the homescreen or via a long press on the home button.







 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.






 



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-05 Thread Taísa Cristina
Whenever I press a key, will the Bookmark activity handle it? Is it a
default behavior that can *not* be configured?


Taísa Cristina Costa dos Santos
Computer Engineer
Brazil, SP
55 19 8152-7453


On Tue, May 5, 2009 at 1:55 PM, Dianne Hackborn hack...@android.com wrote:

 You can't.


 On Tue, May 5, 2009 at 9:53 AM, Taísa Cristina taisa.san...@gmail.comwrote:


 I don't want to handle end call or home keys. I just want to handle
 another key, such as space bar, while my Activity is in background.

 Taísa Cristina Costa dos Santos
 Computer Engineer
 Brazil, SP
 55 19 8152-7453


 On Tue, May 5, 2009 at 1:45 PM, Dianne Hackborn hack...@android.comwrote:

 No, you can't do this.  The home and end call keys are trapped by the
 system before being delivered to the application, and handled by itself.

 On Tue, May 5, 2009 at 5:51 AM, Taísa Cristina 
 taisa.san...@gmail.comwrote:


 My application behavior is similar to voice call, but I need also to
 handle key events. My application is still running in background and the
 activity is paused. Is there a way to receive key events in such situation?
 When the call screen is paused, it receives end call key event. Can I
 receive a specific key event in a similar situation? Is there a way to
 register my activity (or my application) for that?

 Taísa Cristina Costa dos Santos
 Computer Engineer
 Brazil, SP
 55 19 8152-7453


 On Tue, May 5, 2009 at 8:02 AM, ellipsoidmob...@googlemail.com 
 ellipsoidmob...@googlemail.com wrote:


 If what you want is to have a notification that the user can swipe
 down and click to go back to your application, then you don't really
 need to be handling key events whilst your activity is paused. What
 you could do is create a service which displays the notification, and
 then use an intent to launch your activity when the notification is
 clicked.

 BUT - I'm not sure that this is good usability design. If the user has
 navigated away from your activity and if you don't need to do any
 continual background processing, then you probably shouldn't show
 anything in the notification panel. The user can always get back to
 your app from the homescreen or via a long press on the home button.







 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.










 --
 Dianne Hackborn
 Android framework engineer
 hack...@android.com

 Note: please don't send private questions to me, as I don't have time to
 provide private support, and so won't reply to such e-mails.  All such
 questions should be posted on public forums, where I and others can see and
 answer them.


 


--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-05 Thread Streets Of Boston

I really hope that this is *not* possible.
A background application that steals key-strokes is not a good idea.

I won't doubt that your application only has good itentions, but the
idea that i could be downloading a key-stroke sniffer is not very
appealing. I'd rather not have my passwords stolen.

Taisa,
Can you tell us *what* the functionality/task is that you try to
accomplish (not *how*)?
Maybe you can accomplish the same without the need to receive key-
stroke events.


On May 5, 12:53 pm, Taísa Cristina taisa.san...@gmail.com wrote:
 I don't want to handle end call or home keys. I just want to handle another
 key, such as space bar, while my Activity is in background.

 Taísa Cristina Costa dos Santos
 Computer Engineer
 Brazil, SP
 55 19 8152-7453



 On Tue, May 5, 2009 at 1:45 PM, Dianne Hackborn hack...@android.com wrote:
  No, you can't do this.  The home and end call keys are trapped by the
  system before being delivered to the application, and handled by itself.

  On Tue, May 5, 2009 at 5:51 AM, Taísa Cristina 
  taisa.san...@gmail.comwrote:

  My application behavior is similar to voice call, but I need also to
  handle key events. My application is still running in background and the
  activity is paused. Is there a way to receive key events in such situation?
  When the call screen is paused, it receives end call key event. Can I
  receive a specific key event in a similar situation? Is there a way to
  register my activity (or my application) for that?

  Taísa Cristina Costa dos Santos
  Computer Engineer
  Brazil, SP
  55 19 8152-7453

  On Tue, May 5, 2009 at 8:02 AM, ellipsoidmob...@googlemail.com 
  ellipsoidmob...@googlemail.com wrote:

  If what you want is to have a notification that the user can swipe
  down and click to go back to your application, then you don't really
  need to be handling key events whilst your activity is paused. What
  you could do is create a service which displays the notification, and
  then use an intent to launch your activity when the notification is
  clicked.

  BUT - I'm not sure that this is good usability design. If the user has
  navigated away from your activity and if you don't need to do any
  continual background processing, then you probably shouldn't show
  anything in the notification panel. The user can always get back to
  your app from the homescreen or via a long press on the home button.

  --
  Dianne Hackborn
  Android framework engineer
  hack...@android.com

  Note: please don't send private questions to me, as I don't have time to
  provide private support, and so won't reply to such e-mails.  All such
  questions should be posted on public forums, where I and others can see and
  answer them.- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-05 Thread Taísa Cristina
In fact I do need to handle key strokes. It would be easier if I could
handle home key, so that I could prevent the user from going to home screen.
I think it's not a good approach to finish my Activity when it's paused as
well. And it would be very boring for the user to go back to the Activity
whenever he wanted to press a key and make stuff...

Is there a way to register for receiving key strokes if my application is
compiled with the emulator/device image? (should I ask it on
android-platform?)


Taísa Cristina Costa dos Santos
Computer Engineer
Brazil, SP
55 19 8152-7453


On Tue, May 5, 2009 at 2:01 PM, Streets Of Boston
flyingdutc...@gmail.comwrote:


 I really hope that this is *not* possible.
 A background application that steals key-strokes is not a good idea.

 I won't doubt that your application only has good itentions, but the
 idea that i could be downloading a key-stroke sniffer is not very
 appealing. I'd rather not have my passwords stolen.

 Taisa,
 Can you tell us *what* the functionality/task is that you try to
 accomplish (not *how*)?
 Maybe you can accomplish the same without the need to receive key-
 stroke events.


 On May 5, 12:53 pm, Taísa Cristina taisa.san...@gmail.com wrote:
  I don't want to handle end call or home keys. I just want to handle
 another
  key, such as space bar, while my Activity is in background.
 
  Taísa Cristina Costa dos Santos
  Computer Engineer
  Brazil, SP
  55 19 8152-7453
 
 
 
  On Tue, May 5, 2009 at 1:45 PM, Dianne Hackborn hack...@android.com
 wrote:
   No, you can't do this.  The home and end call keys are trapped by the
   system before being delivered to the application, and handled by
 itself.
 
   On Tue, May 5, 2009 at 5:51 AM, Taísa Cristina taisa.san...@gmail.com
 wrote:
 
   My application behavior is similar to voice call, but I need also to
   handle key events. My application is still running in background and
 the
   activity is paused. Is there a way to receive key events in such
 situation?
   When the call screen is paused, it receives end call key event. Can
 I
   receive a specific key event in a similar situation? Is there a way to
   register my activity (or my application) for that?
 
   Taísa Cristina Costa dos Santos
   Computer Engineer
   Brazil, SP
   55 19 8152-7453
 
   On Tue, May 5, 2009 at 8:02 AM, ellipsoidmob...@googlemail.com 
   ellipsoidmob...@googlemail.com wrote:
 
   If what you want is to have a notification that the user can swipe
   down and click to go back to your application, then you don't really
   need to be handling key events whilst your activity is paused. What
   you could do is create a service which displays the notification, and
   then use an intent to launch your activity when the notification is
   clicked.
 
   BUT - I'm not sure that this is good usability design. If the user
 has
   navigated away from your activity and if you don't need to do any
   continual background processing, then you probably shouldn't show
   anything in the notification panel. The user can always get back to
   your app from the homescreen or via a long press on the home button.
 
   --
   Dianne Hackborn
   Android framework engineer
   hack...@android.com
 
   Note: please don't send private questions to me, as I don't have time
 to
   provide private support, and so won't reply to such e-mails.  All such
   questions should be posted on public forums, where I and others can see
 and
   answer them.- Hide quoted text -
 
  - Show quoted text -
 


--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-05 Thread Marco Nelissen
On Tue, May 5, 2009 at 10:14 AM, Taísa Cristina taisa.san...@gmail.comwrote:

 In fact I do need to handle key strokes.


Then you need a foreground activity.

--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-05 Thread Mark Murphy

Taísa Cristina wrote:
 In fact I do need to handle key strokes. 

Find another UI pattern.

 It would be easier if I could
 handle home key, so that I could prevent the user from going to home
 screen.

Find another UI pattern. Prevent the user from going to home screen is
fairly evil and is a tactic I would expect to find from malware.

 And it would be very boring for the user to go back to
 the Activity whenever he wanted to press a key and make stuff...

Find another UI pattern.

 Is there a way to register for receiving key strokes if my application
 is compiled with the emulator/device image? (should I ask it on
 android-platform?)

A list on http://source.android.com/discuss is a better place for
questions about modifying firmware.

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

Android App Developer Books: http://commonsware.com/books.html

--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-04 Thread Marco Nelissen
On Mon, May 4, 2009 at 1:02 PM, Taísa Cristina taisa.san...@gmail.comwrote:


 Hi all,

 I have the following scenario:

 - a main task and a secondary task
 - the secondary task has only one Activity
 - when that Activity is paused (e.g. Home key pressed), a notification is
 inserted to the Notification Bar, so that the user can go back to it (such
 as voice call does)

 My problem is: I need the paused Activity to receive key events.
 1) Is that possible?
 2) If so, how? (I have already tried setting takeKeyEvents(true), but
 whenever I press a key, the Bookmarks activity comes to the foreground)


So you want your paused activity to receive keys instead of the active
foreground activity? That doesn't seem like a very good idea...

--~--~-~--~~~---~--~~
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: Handling key events in a paused Activity

2009-05-04 Thread Mark Murphy

Taísa Cristina wrote:
 - a main task and a secondary task
 - the secondary task has only one Activity
 - when that Activity is paused (e.g. Home key pressed), a notification
 is inserted to the Notification Bar, so that the user can go back to it
 (such as voice call does)
 
 My problem is: I need the paused Activity to receive key events.
 1) Is that possible?

If it is not in the foreground, then I do not think it is possible.

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

Android App Developer Books: http://commonsware.com/books.html

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