R ringmyr Member Licensed User Longtime User Jan 9, 2012 #1 hi i want the first time a user run my open a spec layout show only the first time he start my app. i think is somthing about Code: Copy Sub Activity_Create(FirstTime As Boolean) if firstime the 'the code here to load the layout else show the second layout end if sub end on the right track? /ringmyr
hi i want the first time a user run my open a spec layout show only the first time he start my app. i think is somthing about Code: Copy Sub Activity_Create(FirstTime As Boolean) if firstime the 'the code here to load the layout else show the second layout end if sub end on the right track? /ringmyr
lagore Active Member Licensed User Longtime User Jan 9, 2012 #2 Hi, I am not sure if you mean you only want the user to see the 'special first time layout' only ever once or only on app startup. For only ever once you would have to use an indicator which the first time the app is run would indicate it is the very first launch this could be used to load the 'special layout' then change the indicator and save it then next time the app is launched the the 'normal layout' can be launched. The Code: Copy If FirstTime Then 'load the startup layout End If this will be true the very first time the app is run but also everytime the app runs after the OS has 'killed' it or if we force it killed, read the life cycle of an android app on this forum for a fuller explaination. Edward Upvote 0
Hi, I am not sure if you mean you only want the user to see the 'special first time layout' only ever once or only on app startup. For only ever once you would have to use an indicator which the first time the app is run would indicate it is the very first launch this could be used to load the 'special layout' then change the indicator and save it then next time the app is launched the the 'normal layout' can be launched. The Code: Copy If FirstTime Then 'load the startup layout End If this will be true the very first time the app is run but also everytime the app runs after the OS has 'killed' it or if we force it killed, read the life cycle of an android app on this forum for a fuller explaination. Edward
R ringmyr Member Licensed User Longtime User Jan 9, 2012 #3 oki thx how i set it up right? Last edited: Jan 9, 2012 Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Jan 10, 2012 #4 Code: Copy Sub Activity_Create(FirstTime As Boolean) If File.Exists(File.DirInternal, "1.txt") = False Then File.WriteString(File.DirInternl, "1.txt", "") 'show special layout Else 'show regular layout End If End Sub Upvote 0
Code: Copy Sub Activity_Create(FirstTime As Boolean) If File.Exists(File.DirInternal, "1.txt") = False Then File.WriteString(File.DirInternl, "1.txt", "") 'show special layout Else 'show regular layout End If End Sub