开发者

How to call setContentView() explicitly from other method

开发者 https://www.devze.com 2023-03-20 11:46 出处:网络
In my application for an activity\'s setContentview() I set a class which extends SurfaceView. At first when the app run I able to draw there on surface (bcz there i put Touch events in that class an

In my application for an activity's setContentview() I set a class which extends SurfaceView.

At first when the app run I able to draw there on surface (bcz there i put Touch events in that class and using canvas i able to draw on that surface ), In a option menu click i want different drawings come on same screen/surface (means explicitly i want to draw circle or line on that same canvas)& it should be set to that surface. but how can i do this?

Is ther开发者_如何学Goe any way to call setcontview again then it may solve. U can see my code http://pastebin.com/DZ0hcH3j here.

Thank you


Call invalidate() on your view class. This will call your onDraw() eventually.

0

精彩评论

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