B4A Library [Class] Custom Toast Messages

LucaMs

Expert
Licensed User
Longtime User
Hi.

Your class, which for me would be useful to be able to close a toast, interferes with IME lib. (IME disturbs often).

I use the IME to make visible an EditText that has the focus,
and this works well, but, if I use your class, the EditText is covered by the keyboard.
 

metrick

Active Member
Licensed User
Longtime User
Fatal signal 11 (SIGSEGV)

I wondered if anyone had come across this error please? It occurs with CToast but not Toast, crashing the app randomly on 4.2.2 but not, seemingly, 2.3.6.
I have the same problem with 4.2.2.
 

margret

Well-Known Member
Licensed User
Longtime User

Can you post a cut down version of the project that shows this? If so, I will be glad to look at it.
 

Dave O

Well-Known Member
Licensed User
Longtime User
Hi Margret,

Thanks for this handy (and blissfully small) class. I needed a toast that could be closed on demand (because the normal toast gets behind if you have quick successive actions), and this does the job nicely.

I also tweaked the code to let me specify corner radius and border color as arguments, which makes it look a bit more like the standard toast:

B4X:
Sub ToastMessageShow2(..., Tradius As Int)
...
  If Timage <> "" Then
     ...
   Else
     Dim panelDrawable As ColorDrawable
     panelDrawable.Initialize2(Tbackcolor, Tradius, 1, Colors.LightGray)
     TMS2pan.Background = panelDrawable
   End If
...

Thanks again!
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…