www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Darkflame on September 06, 2010, 01:00:18 pm

Title: How to have a ContextMenu on the GLSurfaceView :?
Post by: Darkflame on September 06, 2010, 01:00:18 pm
Probably a real newbie question, but I'm having a little trouble working out how to have a context menu working
in my GLSurfaceView view.
There doesn't seem to be a "onCreateOptionsMenu" or
"onOptionsItemSelected" to override. (or its protected)

I do notice a "setOnCreateContextMenuListener" but I don't know how to
use it.
Anyone know?
Title: Re: How to have a ContextMenu on the GLSurfaceView :?
Post by: raft on September 06, 2010, 01:19:54 pm
i guess onCreateOptionsMenu() and other similar methods are in Activity, not in View. so you should override it in your activity
Title: Re: How to have a ContextMenu on the GLSurfaceView :?
Post by: EgonOlsen on September 06, 2010, 11:41:05 pm
Just make sure that, if you want to programmatically trigger GUI related work from inside the GL thread, you are creating a Handler in the GUI thread to post the actual workload to in form of a Runnable. Otherwise, Android will complain that you work with GUI components from outside the GUI thread.