0

Is there a way to view all intents that are generated by the Android OS's at any moment but maybe filtered by the activity ? Specifically I am testing the onHoverListener - I want to know if my activity is throwing away the hover motionevent or whether none is being generated (system not capable/ some other problem)

Ideally I would like a log of all intents given to my activity - but some other trick is also fine.

2 Answers2

0

Android intents are , capable for starting a new activity , service , complete any action i.e send email , click photo , fetch data from a content provider etc . Capturing any intent of that kind , you need to have intent filters registered to your activity with the same actions , as that of system intents .[The framework will pick your actvity/app if the same intent is fired and hence you may be able to intercept those intents if the user prefers to] This may be little too much as there will be so many of the actions declared for different android components .But some popular examples are sending sms , picking a contact , send mail . Please refer to this for more info :http://developer.android.com/guide/components/intents-filters.html

Events and Intents are different all together , all events generated by your app will go the event handler queue of the UI thread . So in order to intercept you should set appropriate event listeners to your activity components .

user501818
  • 94
  • 5
0

Try using onTouch instead . setOnTouchListener(new OnTouchListener() {

    @Override
    public boolean onTouch(View v, MotionEvent event) {
        if(event.getAction() == MotionEvent.ACTION_DOWN){
            //Button Pressed
        }
        if(event.getAction() == MotionEvent.ACTION_UP){
             //finger was lifted
        }
        return false;
    }`
user501818
  • 94
  • 5