title: Is it possible to use Switch widget in a menu item in my Android app? For example same as checkbox when android:checkable="true", but Switch
body: <p>Is it possible to use Switch widget in a menu item in my Android app? For example same as checkbox when android:checkable=&quot;true&quot;, but Switch...
  The only way I can use menu item checkable state is this...</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;menu xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
      &lt;item
          android:id=&quot;@+id/vibration_options_item&quot;
          android:title=&quot;Vibration&quot;
          android:checkable=&quot;true&quot;
          android:checked=&quot;true&quot;/&gt;
  &lt;/menu&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/aCJ81.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aCJ81.png" alt="enter image description here" /></a></p>
  <p>But, I feel like it is more intuitive for a user to use Switch widget instead of Checkbox</p>
  <p>And when I try to use Switch instead, it shows nothing unfortunately...</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;menu xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;&gt;
      &lt;item
          android:id=&quot;@+id/vibration_options_item&quot;
          android:title=&quot;Vibration&quot;
          app:actionViewClass=&quot;android.widget.Switch&quot;
          app:showAsAction=&quot;never&quot;/&gt;
  &lt;/menu&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/lPzRo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lPzRo.png" alt="enter image description here" /></a></p>