开发者

opposite of setContentView

in my Activity subclass OnCreate method i use setContentView(XXX) to setup the window layout. In certain circumstances it is necessary, at 'OnStart' time, for this Activity to be stopped. Calling in the OnStart the Activity.finish() method, actually stop the execut开发者_Go百科ion but cause a ugly flicker effect where my layout is shown for an instant before application dies.

Question is: is there an opposite of setContentView? Can I use an ipotetic clearContentView to empty the layout and avoid the flickering?

Thanks in advance L.


You can make a clean xml clear.xml with no content and

setContentView(clear); 

You can try, but i'm not sure it'll help .


Or you can set TextView with no text inspite of creating new xml.

TextView tv = new TextView(this);
tv.setText("");
setContentView(tv);

I'm not sure it'll help, too


You can pass null to setcontentview as below

setContentView(null);

Using this your activity defines null to layout view

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜