12-09-2010 11:37 AM - edited 12-09-2010 11:44 AM
I am wondering about two possibilities between these ones:
1) Am I completly blind and cannot I read a Java reference?
2) Is it possible that RIM didn't even provided us an Event to handle tilt action, and advices us to use code tricks with the sublayout methods ?
Somebody has an answer?
12-09-2010 12:10 PM
12-10-2010 04:15 AM
Indeed, but the accelerometer listener always listen to the orientation, but here an alert from BB:
"Subscribing to accelerometer sensor readings is costly for the device battery, and should therefore only be used only when necessary."
The sublayout method may work but we need to register the last width in a private parameter. The pattern is not very sexy. Because:
-We need to reimplement this in all Screen in the extends hierarchy. If we change the lastWidth param for MyGenericScreen, the class MyImplementedScreen may not detect the tilt if we do not implement again the trick.
- We may want an action onTilt that has nothing to do with sublayout, but we still need to pass through it. so we need to get the event on every screen that can be push to stack to be certain to catch the event.