Android – is it possible to make action “clickable”?

I'm using the actionbarsherlock library for my API level 10 application. I wonder if it's possible to click an action icon that doesn't respond

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/mainTopBluetoothState"
        android:icon="@drawable/bt_not_connected"
        android:orderInCategory="0"
        android:clickable="false"
        android:showAsAction="ifRoom" />

    <item android:id="@+id/mainTopAppState"
        android:title="App State"
        android:orderInCategory="1"
        android:showAsAction="ifRoom" />

</menu>

Android: clickable = "false" will not generate an error, but pressing action will still react when the application is running

resolvent:

Try Android: enable or setenabled() at runtime on the MenuItem

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>