I'm trying to call my 2nd activity from the SurfaceView, but couldn't succeed, there are many examples how to start an intent from the MainActivity class, but there are no examples how to call it from the SurfaceView using a method without using any button to set listener.
I'm trying to throw something like this on SurfaceView that can be called by other classes. But that just doesn't work.. any suggestions would be nice. I'm sure this is not the right way because this code become unrecognizable when it's placed in SurfaceView, any suggestions would be nice. Cheers!
public void switchActivity2()
{
Intent i = new Intent(MainActivity.this, Activity2.class);
startActivity(i);
}