Here’s one pretty simple way to get your custom view to restore its current state after an orientation change: You can of course put any values in there, for example if you need to restore fields. (quickly plotted code. Haven’t run it, but it should work)
A simple function to convert dp into pixels. Use when you have to pass pixels to a method and want to keep everything to scale. From Android Developer Center : pxPixels – Corresponds to actual pixels on the screen. This unit of measure is not recommended because the actual representation can vary across devices; each… Read More »
Add an event handler for Form Closing and use this code. This is a really simple solution.