I can customize and use the BCToast quite successfully. But everytime when my app goes to the background (paused) then comes back, I could not show the toast again. I don't know what is wrong here?
Here is the error:
My code:
Thanks
Here is the error:
(NullPointerException) java.lang.NullPointerException: Attempt to invoke virtual method 'void anywheresoftware.b4a.objects.B4XViewWrapper.setColor(int)
on a null object reference
My code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
bctoast.Initialize(toastPanel) ' toastPanel is the toast parent view
End If
End Sub
Sub ShowBCToast(message As String, fontcolor As String, backgrcolor As Int)
' Example for the color => "color=#ff00ff" Or "color=White"
bctoast.DurationMs = 4000
bctoast.PaddingTopBottom = 10dip
bctoast.VerticalCenterPercentage = 50
bctoast.pnl.Color = backgrcolor
bctoast.Show($"[Alignment=Center][TextSize=16][b][${fontcolor}]${message}[/color][/b][/TextSize][/Alignment]"$)
End Sub
Thanks