Sub Activity_Create(FirstTime As Boolean)
'Set screen brightness max
Private pi As Phone
pi.SetScreenBrightness(1)
'Set the correct layout landscape-portrait
If 100%y > 100%x Then
Activity.LoadLayout("Preview")
Else
Activity.LoadLayout("previewLandscape")
End If
'Get if user is lisenced in order to show ads
If Info.licensed=False Then
adInt.Initialize("mwadi","ca-app-pub-49399549238*****/868696****")
adInt.LoadAd
End If
'Set the correct rotation of the taken photo from camera
Dim exif As ExifData
exif.Initialize(Main.dir,Main.filename)
Log(exif.getAttribute(exif.TAG_ORIENTATION))
If exif.getAttribute(exif.TAG_ORIENTATION) = 1 Then
Dim newImage As Bitmap = RotateImage(LoadBitmap(Main.dir,Main.filename),0,1)
Else If exif.getAttribute(exif.TAG_ORIENTATION) = 3 Then
Dim newImage As Bitmap = RotateImage(LoadBitmap(Main.dir,Main.filename),180,2)
Else If exif.getAttribute(exif.TAG_ORIENTATION) = 6 Then
Dim newImage As Bitmap = RotateImage(LoadBitmap(Main.dir,Main.filename),90,3)
Else If exif.getAttribute(exif.TAG_ORIENTATION) = 8 Then
Dim newImage As Bitmap = RotateImage(LoadBitmap(Main.dir,Main.filename),-90,3)
End If
'Set to saveImage the taken photo
saveImage=newImage
'Put the taken photo to panel
pnlPhoto.SetBackgroundImage(newImage)
'Dim the share photo BitmapDrawable(library - button with icon)
Dim bm As BitmapDrawable
bm.Initialize(LoadBitmap(File.DirAssets,"ic_action_share.png"))
btnShare.BackgroundColor=Colors.ARGB(200,30,144,255)
btnShare.TextColor=Colors.White
btnShare.Text="Share"
'btnShare.IconPadding=0
btnShare.setIcon(True,bm)
'Dim the save photo BitmapDrawable(library - button with icon)
Dim bm As BitmapDrawable
bm.Initialize(LoadBitmap(File.DirAssets,"ic_action_download.png"))
btnSave.BackgroundColor=Colors.ARGB(200,0,128,0)
btnSave.TextColor=Colors.White
btnSave.Text="Save"
'btnSave.IconPadding=0
btnSave.setIcon(True,bm)
'Dim the delete photo BitmapDrawable(library - button with icon)
Dim bm As BitmapDrawable
bm.Initialize(LoadBitmap(File.DirAssets,"ic_action_cancel.png"))
btnDelete.TextColor=Colors.White
btnDelete.BackgroundColor=Colors.ARGB(200,255,0,0)
btnDelete.Text="Delete"
'btnDelete.IconPadding=0
btnDelete.setIcon(True,bm)
ProgressDialogHide
End Sub