I have an application with a SurfaceHolder based view (similar to the Lunar Lander tutorial). The entire GUI is drawn on the canvas, and I want you to be able to request user text input at the moment, using a special dialog dialog, which is then processed and displayed on the canvas using the standard procedure.
My problem, however, is that it is best to open dialog boxes from Activity. This is also not a problem, because I thought I could create a handler and then pass it to a view, which, in turn, can use it to send messages from the GUI stream in the "Activity" view, which, in turn, could get an input, and send a response back, etc.
The problem is that after calling setContentView(R.layout.main) , which contains the entire application, I want to call MyAppView mMyAppView = (MyAppView) findViewById(R.id.app_view_id) .
This call returns null .
What is considered best practice here? I canβt find any good examples, and the API appears, well, not so many.
I would appreciate any help here.
source share