• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps callback function for when the G1 flips open

Leolicos

Member
Does there exist a function that hasa callback when the G1 flips open and closed? I'm still a bit new and I'm on the final steps of my first app, doing bug tests and such, and the flip is the only problem I'm having so far.
 
Do you want to be notified when the keyboard is flipped open?

Normally when the keyboard is opened or closed or the orientation is changed the activity is destroyed and a new one is created. So if you have values in edit text boxes that you haven't saved, you will lose them. You should be able to check whether the keyboard is open or not in your oncreate method.

You can avoid the destruction and recreation of your activity by adding keyboardHidden to configChanges in your manifest. Then instead of destroying and creating your activity itw ill call onConfigurationCHanged instead which you can override and do whatever you want. But, there may be some housekeeping you need to do manually then.
 
That worked, but I'm having a problem with my simulator on the computer. It seems when I press "page up" it switches views and toggles from landscape to portrait, but when I read the orientation it's always landscape, same with getRequestedOrientation() at onCreate(), it always returns landscape. Is that just how the simulator works or is there a setting I have to change?
 
That worked, but I'm having a problem with my simulator on the computer. It seems when I press "page up" it switches views and toggles from landscape to portrait, but when I read the orientation it's always landscape, same with getRequestedOrientation() at onCreate(), it always returns landscape. Is that just how the simulator works or is there a setting I have to change?
 
Back
Top Bottom