Author Topic: How to have a ContextMenu on the GLSurfaceView :?  (Read 1947 times)

Offline Darkflame

  • int
  • **
  • Posts: 55
    • View Profile
How to have a ContextMenu on the GLSurfaceView :?
« 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?

Offline raft

  • quad
  • ******
  • Posts: 1966
    • View Profile
    • http://www.aptalkarga.com
Re: How to have a ContextMenu on the GLSurfaceView :?
« Reply #1 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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: How to have a ContextMenu on the GLSurfaceView :?
« Reply #2 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.