w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How do I open ContextMenu with a Button

You can use openContextMenu instead of showContextMenu.

registerForContextMenu(btn);
btn.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        openContextMenu(v);
    }
});




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.