Why do you need the Phone.SetScreenOrientation call? You should instead set the supportedOrientation attribute.
Actually I have used both. They seem to be equivalent, are they?
Phone.SetScreenOrientation occurs at runtime. In other projects I have used this, for example, to lock phones in portrait while allowing tablets to change orientation.
For this test project only portrait orientation makes sense. When taking pictures or videos the device can be rotated and the results are correct. I hope this is not causing the anomaly I see on my 2.2 device
*** Added Later... ***
On my 2.2 device I tried both ways, using the Attribute and using the Phone setting. Both seem to work identically. But, then by accident I noticed something else :sign0148:
With the screen locked in portrait (using either method) if I use the VideoRecordApp holding the phone in portrait mode I get the extra Activity_Create executions. But, with the screen locked in portrait, if I hold the phone in landscape and execute the VideoRecordApp I don't get the Activity_Create executions. This only happens on my 2.2 phone – my 4.0.3 phone and other devices operate as expected.
Samsung Vibrant (Android 2.2) holding phone in portrait
7>> btnVR_Click()
8>> VideoRec.Record()
** Service (contentsrv) Start **
Service Start
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
** Activity (main) Create, isFirst = false **
running waiting messages (1)
9>> Vid Rec Comp, Success = true
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = false **
** Activity (main) Resume **
Samsung Vibrant (Android 2.2) holding phone in landscape
10>> btnVR_Click()
11>> VideoRec.Record()
** Service (contentsrv) Start **
Service Start
** Activity (main) Pause, UserClosed = false **
sending message to waiting queue (OnActivityResult)
running waiting messages (1)
12>> Vid Rec Comp, Success = true
** Activity (main) Resume **
I'm starting to get the feeling that this has nothing to do with the VideoRecordApp or B4A, but is just the implementation of Android 2.2 on the Vibrant by Samsung.
I am looking for a cheap, used, 2.2 or 2.3 phone on eBay to use as an additional development device.
I save and restore state in my target app. I will have to make sure it handles returning from a video recording also.
The important thing is that, with the service added, it is always running the _RecordComplete (and Chooser_Result) routine.
Thanks,
Barry.