Set Content View from R.layout.main to surface view

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Set Content View from R.layout.main to surface view

Postby tensaix2j » Mon Feb 09, 2009 6:03 pm

The problem goes like this:

I have implemented a surface view that gets rendered every 50 ms using the manual draw(canvas) method.
it works fine when i do instantiation and setContentView() upon activity's OnCreate event as such:

// Activity onCreate Event...

xxx = new myView();

However, when i have an XML layout, with a few buttons on it, and I change the Activity's OnCreate event to setContentView() to an XML layout first :


,and then in one of my buttons' onClick, i do setContentView() to my SurfaceView
using the exact code previously ...

xxx = new myView();

but i get a blank screen upon changing the view from XML layout view to my own Surface View, in which i don't see any canvas drawing completely.....

Posts: 5
Joined: Tue Jan 06, 2009 7:35 am


Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 2 guests