Im experienced iOS dev but new to Android dev and asking some newbie questions here…
I am making a app that does a lot of custom drawing of png’s and animations and has no standard UI elements at all, and I have choosen to go down the SurfaceView road. I handle all the detection on what is touched in my SurfaceView code also.
But how on earth do I handle navigation between views from within my SurfaceView code? How do I e.g. navigate to a activity called QuizActivity? In a “normal” view/activity I do it like this:
Intent intent = new Intent(getBaseContext(), QuizActivity.class);
startActivity(intent);
But I do not have access to getBaseContext and startActivity from within my SurfaceView, and even if I did would doing this result in multiple views loaded at the same time?
Bottom line: How do I implement this navigation manually in my code from within my SurfaceView?
Thank you
Søren
from your surface view just call:
every view have a reference to the context they’re running, and the context can always start new activities, services, get the resources, etc.
edit
on your surfaceview you include this:
and on the activity that holds the surface you do this:
does it make sense???