开发者

SEARCH_LONG_PRESS in a broadcast not working?

开发者 https://www.devze.com 2023-02-16 00:17 出处:网络
This is not working. Any idea why I can not receive long search keypress? AndroidManifest.xml <receiver android:enabled=\"true\" android:name=\".MainReceiver\" >

This is not working. Any idea why I can not receive long search keypress?

AndroidManifest.xml

    <receiver android:enabled="true" android:name=".MainReceiver" >
        <intent-filter android:priority="10000">
            <action android:name="android.intent.action.SEARCH_LONG_PRESS" />
        </intent-filter>
    </receiver>

MainReceiver.java

public class MainReceiver extends BroadcastReceiver
{
    @Override
    public vo开发者_如何学Pythonid onReceive( Context context, Intent intent )
    {
      // Nothing comes here..   
    }

}


thanks guys, i found the answer in the android documentation. It looks like Search button can not be used as a broadcast action. it is only an activity action.

ACTION_SEARCH_LONG_PRESS Activity Action: Start action associated with long pressing on the search key.

0

精彩评论

暂无评论...
验证码 换一张
取 消