0

i amm trying to listen to the broadcast for LONG_TAP to override google search. I would like my application to define a LONG_TAP gesture. Please suggest an alternative method or a solution to this... Code:

    @Override
public void onReceive(Context context, Intent intent) {
    // TODO Auto-generated method stub
    if (intent.getAction().equals("com.google.glass.action.LONG_TAP")) {
        //abortBroadcast();

        System.out.println("Yaay..!!! could listen to the long tap");

        //abortBroadcast();
    }
}

1 Answers1

0

Alright turns out that later versions of google glass have changed the LONG_TAP to LONG_PRESS So the code goes

@Override
public void onReceive(Context context, Intent intent) {
    // TODO Auto-generated method stub
    if (intent.getAction().equals("com.google.glass.action.LONG_PRESS")) {
        //abortBroadcast();

        System.out.println("Yaay..!!! could listen to the long tap");

        //abortBroadcast();
    }
}

and android manifest

<receiver android:name="HeadOnBroadCastReceiver" android:exported="false">
    <intent-filter android:priority="1000" >
        <action android:name="com.google.glass.action.LONG_PRESS" />
    </intent-filter>
</receiver>

But it still wont work when the device is asleep..Please reply if you have a better solution to work when the device is asleep....and thanks Mike DiGiovanni for your help

Tony Allevato
  • 6,429
  • 1
  • 29
  • 34