efficient way to perform action once window has been painted

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

efficient way to perform action once window has been painted

Postby sandis84 » Thu Aug 20, 2009 1:36 pm

It is quite often that I want to perform an action that cannot be performed until the window has been generated, for example if I want to count the rows in an edittext. Right now my solution is to extend the object and override the onDraw-function to perform my action. But it feels as if there should be a neater way. Any suggestions?
sandis84
Experienced Developer
Experienced Developer
 
Posts: 78
Joined: Fri Aug 07, 2009 3:54 pm

Top

Postby mad.dogg » Thu Aug 20, 2009 3:30 pm

Perhaps somewhere in the activity's lifecycle?
It depends. Is it action per component or action per "window" activity? Is it just the first time or every time the activity/component has been intialized?
If it's boring it ain't heavy enough!
mad.dogg
Developer
Developer
 
Posts: 42
Joined: Tue May 20, 2008 2:18 pm
Location: Bulgaria

Postby sandis84 » Thu Aug 20, 2009 3:32 pm

For example, I might want to change row distance for all multi-lined textviews. Then I want it to initiate as soon as possible, but not until it has been drawn. That is a typical example. :)
sandis84
Experienced Developer
Experienced Developer
 
Posts: 78
Joined: Fri Aug 07, 2009 3:54 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 8 guests