-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the next toast hiding the current one #50
Comments
Can you show the code which hides and shows the toast? |
Sure, thanks for the fast answer! (I'm also using this controller to play an audio file) $scope.play = function(src,message) {
var media = new Media(src, function onSuccess() {
// release the media resource once finished playing
media.release();
},
function onError(e){
console.log("error playing sound: " + JSON.stringify(e));
});
media.play();
// TOAST
window.plugins.toast.hide();
$cordovaToast.show(message, 'long', 'bottom').then(function(success) {
console.log("The toast was shown");
}, function (error) {
console.log("The toast was not shown due to " + error);
});
}; |
I'm guessing you need to put that ..hide(function() {
// ..show here
}); |
Sorry didn't managed to make it work. Is that what you meant? $cordovaToast.hide().then(function(success) {
$cordovaToast.show(message, 'long', 'bottom');
}); |
I don't think ngCordova supports the window.plugins.toast.hide(function() {
// you're now in the succes callback handler of the 'hide' function
$cordovaToast.show(message, 'long', 'bottom');
}); |
Hello,
great plugin! I'm having some (noob) trouble with multiple toasts though (on Android).
I would like the next toast to erase / replace the previous one if it's still being shown. I tried using window.plugins.toast.hide(); before showing the new toast but it hides the previous AND next one (basicaly nothing appears)
Am I missing something?
The text was updated successfully, but these errors were encountered: