Devices with Android + MIUI and setCustomSelectionActionModeCallback

前端 未结 4 1678
迷失自我
迷失自我 2021-02-04 23:54

I\'m trying to create custom selection menu but it does not work on a device with rom MIUI and Android 6. The result is common menu with copy and select all

4条回答
  •  隐瞒了意图╮
    2021-02-05 00:20

    Just some thoughts. What if you take menu item onCreateOptionsMenu and change it.

    Like this:

    public boolean onCreateOptionsMenu(final Menu menu) {
      getSupportMenuInflater().inflate(R.menu.main, menu);
      new Handler().post( -> {
          final View menuItemView = findViewById(R.id.menu_action_item);
          ...
      }
    }
    

提交回复
热议问题