I have receive some crash lately using this code
First of all I guess I am doing something wrong and please do correct my implementation !
I just wanted to wait for the app splash to load before showing something else, I guess is better to use a timer instead.
Please explain why is important for the main thread to keep on going .
I do not want to start changing all msgbox2 to the new asynchronous method because I do not understand it.
You say that Msgbox2 will crash our apps and is not wanted any more ?
I am very confused about the sleep usage and now with the msgbox as well !!
B4X:
Sub grab_customer
Sleep(2000)
If manager_ready Then
'grab customer from time to time
If File.Exists(File.DirInternal,"trialcustomer.txt")=False Then
File.WriteString(File.DirInternal,"trialcustomer.txt",DateTime.Now)
Else
trialcustomer=File.ReadString(File.DirInternal,"trialcustomer.txt")
If trialcustomer < DateTime.Now - 3*DateTime.TicksPerDay Then
Dim re As Int
re=Msgbox2("We thank you for choosing our apps. Do you want to unlock star delta features now ?","Electrician app","OK LET'S GO","no","",Null)
If re=DialogResponse.POSITIVE Then
Try
manager.RequestPayment("noads","inapp","ads")
Catch
ToastMessageShow("Billing manager not ready",True)
End Try
Else if re=DialogResponse.NEGATIVE Then
trialcustomer=DateTime.Now 'reset and ask after 3 days again
File.WriteString(File.DirInternal,"trialcustomer.txt",trialcustomer)
Else
'same practice
trialcustomer=DateTime.Now
File.WriteString(File.DirInternal,"trialcustomer.txt",trialcustomer)
End If
End If
End If
End If
End Sub
First of all I guess I am doing something wrong and please do correct my implementation !
I just wanted to wait for the app splash to load before showing something else, I guess is better to use a timer instead.
Please explain why is important for the main thread to keep on going .
I do not want to start changing all msgbox2 to the new asynchronous method because I do not understand it.
You say that Msgbox2 will crash our apps and is not wanted any more ?
I am very confused about the sleep usage and now with the msgbox as well !!