1. Download our Official Android App: Forums for Android!

Apps How to get key events when application is in background

Discussion in 'Android Development' started by vivart, Dec 15, 2009.

  1. vivart

    vivart Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    4
    Joined:
    Dec 15, 2009

    Dec 15, 2009
    4
    0
    5
    How to get key events when application is in background?
     

    Advertisement

  2. vivart

    vivart Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    4
    Joined:
    Dec 15, 2009

    Dec 15, 2009
    4
    0
    5
    My application has more than 20 screens so i am confused that which one is the best approach.
    1. one activity and changing the views
    2. separate activity for all screens.
     
  3. wige

    wige Member
    Rank:
    None
    Points:
    35
    Posts:
    46
    Joined:
    Oct 28, 2009

    Oct 28, 2009
    46
    0
    35
    Director of IT
    Pennsylvania, USA
    I think, but am not sure, that the general way to do this is to register a service that will listen for key events that are not handled by whatever is in the foreground.

    This will probably depend greatly on what all of the different screens do. At the most general level, you will probably have a mix, changing views when you work with data differently, and different activities for different data sets.
     
  4. acjohnson55

    acjohnson55 Member
    Rank:
    None
    Points:
    16
    Posts:
    30
    Joined:
    Dec 6, 2009

    Dec 6, 2009
    30
    3
    16
    Can you provide any information on any API methods needed to register a service like this? I want to make a service that hooks long presses of the home key and replaces the system Recent Apps screen
     
  5. ashwini.dabir

    ashwini.dabir Lurker
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Jul 30, 2010

    Jul 30, 2010
    2
    0
    5

    I need to do a similar thing. Did u find any luck on this post ? any API's or methods to override the native long press of Home Key (detect by a service) ?? Thanks in advance.
     
  6. ashwini.dabir

    ashwini.dabir Lurker
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Jul 30, 2010

    Jul 30, 2010
    2
    0
    5
    I need to do a similar thing. Did u find any luck on this post ? any API's or methods to override the native long press of Home Key (detect by a service) ?? Thanks in advance.
     

Share This Page

Loading...