How to handle onContextItemSelected in a multi fragment activity?

前端 未结 11 2096
天命终不由人
天命终不由人 2020-11-29 17:26

I\'m currently trying to adapt my application to use the \"Compatibility Libraries for Android v4\" to provide the benefits of the usage of fragments even to Android 1.6 use

11条回答
  •  隐瞒了意图╮
    2020-11-29 18:19

    I found an alternative. It does not change anything on my problem above, but it makes it pointless.

    I have remove the context menu completely from my application. Instead I capture the longclick on a list item and change the visible buttons of the action bar in this moment. From the user point of view this is much more tablet like as a context menu.

    In backward compatible applications the actionbar does not exist. So I've decided to build my own (kind of toolbar on top) for the devices pre Honeycomb.

    If you would like to stay with the context menu, I did not find a better solution as the workaround I've mentioned above.

提交回复
热议问题