Comments (17)
The crash occurs whatever color you specify.
Again, a quick workaround to prevent the crash would be to skip color assignments on android 11.
Let me know if you need some help with the PR.
from toast.
GWS @ishrakland :D
from toast.
https://stackoverflow.com/questions/62884286/toast-getview-returns-null-on-android-11-api-30
from toast.
My suggestion if you do not have the time to work on a full fix, would be to skip colors assignments on android 11, which would avoid the crash.
I can do the PR if you want.
from toast.
Hello , @tranb3r i will fix it as soon as possible. Thank you for your help.
from toast.
@ishrakland Any update ? A quick fix to prevent the crash by ignoring colors would be good enough...
from toast.
try custom toast you can specify the color you want. I will fix it : i have a lot of charge.
from toast.
Experiencing the same issue
from toast.
@ishrakland I understand you may not have the time to work on this issue. Do you think you can provide a fix, or at least merge a quick fix to prevent the crash if I do the PR ?
I really like this plugin, but considering the impact of this issue, I'm thinking about moving to xamarin-community-toolkit which also has a toast functionnality.
from toast.
Same problem here.... and based on the time it got reported.. I assume it won't get fix soon
from toast.
from toast.
It's free plugin, opensource and i don't get money from it . it's open for all users to contribute.
from toast.
Maintaining this kind of plugin is too big a challenge for the long-term, and the xamarin community toolkit already has a toast functionality.
I think you should consider merging your code into their repo if you think you can provide additional features.
from toast.
@tranb3r Yes, thank you
from toast.
Did you find any solution @tranb3r
Yes, I'm using xamarin community toolkit now, instead of this plugin.
from toast.
I'm thinking that the following changes in ShowToastPopUp.cs in Android should fix it
private void ShowMessage(string message, string backgroundHexColor = null, string textHexColor = null, Abstractions.ToastLength toastLength = Abstractions.ToastLength.Short)
{
var length = toastLength == Abstractions.ToastLength.Short ? Android.Widget.ToastLength.Short : Android.Widget.ToastLength.Long;
// To dismiss existing toast, otherwise, the screen will be populated with it if the user do so
_instance?.Cancel();
_instance = Android.Widget.Toast.MakeText(Android.App.Application.Context, message, length);
if (Xamarin.Essentials.DeviceInfo.Version.Major <= 10)
{
View tView = _instance.View;
if (!string.IsNullOrEmpty(backgroundHexColor))
tView.Background.SetColorFilter(Color.ParseColor(backgroundHexColor), PorterDuff.Mode.SrcIn);//Gets the actual oval background of the Toast then sets the color filter
TextView text = (TextView)tView.FindViewById(Android.Resource.Id.Message);
if (!string.IsNullOrEmpty(textHexColor))
text.SetTextColor(Color.ParseColor(textHexColor));
}
_instance.Show();
}
from toast.
Hi.
This issue is still repeating in Android 11.
When are you coming out with the updated plugin.toast to handle this issue?
Thanks.
from toast.
Related Issues (19)
- It's a copy from Plugin.Toast.Abstractions HOT 1
- Mac support
- UnhandledException on UWP HOT 9
- Adding options feature should be good HOT 1
- UWP support HOT 3
- 2.1.3 is broken HOT 5
- Toast in fullscreen on iOS 14
- Deprecated debug information level HOT 1
- UWP - System.IO.FileNotFoundException: Could not load file or assembly 'Plugin.Toast, Version=2.1.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. HOT 1
- How to close an issue - toast or popups
- It crushes on Android 11 HOT 3
- Issue in iOS HOT 1
- Not Working On Android 12
- Exception has been thrown by the target of an invocation.
- Plugin not compatible with Andoid 14
- Is there any chance to work on Windows applications? HOT 2
- Could we have a way to specify the delay before the toast disappears? HOT 4
- IOS application freezes on multiple popups HOT 21
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toast.