Hello, I'm making an app and I'm trying to implement a context menu for a textview item(similar to this, but the options will take you to different activities), and there's an error in the last line of this bit. 'menu' is underlined, saying 'expression expected' I'm an android noob, so any help is appreciated.
@Override
public void registerForContextMenu(View view) {
super.registerForContextMenu(findViewById(R.id.*textview name*));
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_options,menu );
}
>'menu' is underlined
in the context you have posted it is undefined so maybe thats the problem
the official documentation might help
>https://developer.android.com/guide/topics/ui/menus.html#context-menu
gl
>>365367
Yeah, I have a feeling that i'd need to establish menu as some sort of variable but I'm not sure what I'd set it as- I'll check my code when I get back home, maybe a few hours away from it made it clearer for me to see what I need to do