Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then 'if double pressed {exit} or single pressed {return}
If WebView_Main.tag = "https://beisat.com/" & Starter.language & "/" Or WebView_Main.tag = "https://beisat.com/" & Starter.language & "/" Then
Timer_exit.Interval = 2000
Timer_exit.Enabled = True
backButtonCounter = backButtonCounter + 1
If backButtonCounter > 1 Then
CloseActivities
End If
ToastMessageShow(translator.translate("Press Back button again to exit"), False)
Else
WebView_Main.onBackPressed 'go to prevoius web page
Timer_exit.Interval = 500
Timer_exit.Enabled = True
backButtonCounter = backButtonCounter + 1
If backButtonCounter > 1 Then
CloseActivities
End If
grayer
End If
Return True
Else
Return False
End If
End Sub