salam dostan didin ke bazi oqat to ye seri az soft ha ro goshi nasb mikoni mikhay back bedi mige 2 bar click kon ta khoroj shi man on cod ro mikham kesi dare?
thanx
thanx
No user |
#Region Project Attributes
#ApplicationLabel: B4A Example
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim i As Boolean
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If keycode = KeyCodes.KEYCODE_BACK Then
If i = False Then
ToastMessageShow("Click Again For Exit",False)
i = True
Return True
Else
Return False
End If
Else
Return False
End If
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim i As Boolean
Dim timer1 As Timer
Dim sec As Int <<<~~ vase shemordane sanie
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Layout1")
timer1.Initialize("timer1",1000)
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean
If KeyCode = KeyCodes.KEYCODE_BACK Then
If i = False Then
timer1.Enabled = True <<<~~ timer faaal beshe vase zaman gereftane 3 sanie
ToastMessageShow("Click Again For Exit",False)
i = True
Return True
Else
Return False
End If
Else
Return False
End If
End Sub
Sub timer1_tick
If sec <= 3 Then <<<~~ age sanie koochiktar ya mosavie 3 bood
sec = sec+1 <<<~~ yeki be sanie ezafe kone
Else <<<~~ age bishtar az 3 sanie shod
i = False <<<~~ bool ro false kone ta age 10 min dg back ro bezane ba 1 bar back zadan return false nashe !
timer1.Enabled = False <<<~~ timer ro stop mikonim
End If
End Sub