{"action":"created","issue":{"url":"https://api.github.com/repos/aritchie/userdialogs/issues/48","labels_url":"https://api.github.com/repos/aritchie/userdialogs/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/aritchie/userdialogs/issues/48/comments","events_url":"https://api.github.com/repos/aritchie/userdialogs/issues/48/events","html_url":"https://github.com/aritchie/userdialogs/issues/48","id":100417177,"number":48,"title":"Display Toast causes exception on iOS and Android","user":{"login":"epactscott","id":13004154,"avatar_url":"https://avatars.githubusercontent.com/u/13004154?v=3","gravatar_id":"","url":"https://api.github.com/users/epactscott","html_url":"https://github.com/epactscott","followers_url":"https://api.github.com/users/epactscott/followers","following_url":"https://api.github.com/users/epactscott/following{/other_user}","gists_url":"https://api.github.com/users/epactscott/gists{/gist_id}","starred_url":"https://api.github.com/users/epactscott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/epactscott/subscriptions","organizations_url":"https://api.github.com/users/epactscott/orgs","repos_url":"https://api.github.com/users/epactscott/repos","events_url":"https://api.github.com/users/epactscott/events{/privacy}","received_events_url":"https://api.github.com/users/epactscott/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/aritchie/userdialogs/labels/not%20a%20bug","name":"not a bug","color":"e6e6e6"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-08-11T21:33:17Z","updated_at":"2015-08-12T13:45:09Z","closed_at":null,"body":"I was previously displaying Toasts in my Xamarin.Forms app with version 3.4 without any trouble.  However today I upgraded to 4.0.2 and I get a null pointer exception any time I try to display a Toast.\r\nI display the Toast with the following code:\r\n\r\nUserDialogs.Instance.WarnToast(\"You are not connected to the internet and will be accessing cached data\", 5000); \r\n\r\nI no longer have any UserDialog.Init code in my iOS AppDelegate, and I have UserDialogs.Init (this, true); in my android MainActivity.\r\n\r\nRunning on the iphone simulator I get the following error:\r\n\r\n015-08-11 14:24:46.019 OrgAdmin.iOS[12387:1249093] Unhandled managed exception:\r\nObject reference not set to an instance of an object (System.NullReferenceException)\r\n  at MessageBar.MessageView.Draw (CGRect rect) [0x000ee] in <filename unknown>:0 \r\n  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)\r\n  at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/1962/8b265d64/source/maccore/src/UIKit/UIApplication.cs:63 \r\n  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/1962/8b265d64/source/maccore/src/UIKit/UIApplication.cs:47 \r\n  at OrgAdmin.iOS.Application.Main (System.String[] args) [0x00008] in /Users/scott/_devroot/work/epact-org-admin-app/xamarin/OrgAdmin/iOS/Main.cs:17 \r\n\r\n\r\nRunning on an android tablet I get this error:\r\n\r\n[MonoDroid] UNHANDLED EXCEPTION:\r\n[MonoDroid] Android.Views.InflateException: Exception of type 'Android.Views.InflateException' was thrown.\r\n[MonoDroid] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <IL 0x00011, 0x00078>\r\n[MonoDroid] at Android.Runtime.JNIEnv.CallStaticObjectMethod (intptr,intptr,Android.Runtime.JValue*) [0x00064] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.g.cs:1301\r\n[MonoDroid] at Android.Support.Design.Widget.Snackbar.Make (Android.Views.View,Java.Lang.ICharSequence,int) <IL 0x0007e, 0x0038f>\r\n[MonoDroid] at Android.Support.Design.Widget.Snackbar.Make (Android.Views.View,string,int) <IL 0x00016, 0x000e3>\r\n[MonoDroid] at Acr.UserDialogs.AppCompatUserDialogsImpl.Toast (Acr.UserDialogs.ToastConfig) <IL 0x00049, 0x00277>\r\n[MonoDroid] at Acr.UserDialogs.AbstractUserDialogs.Toast (Acr.UserDialogs.ToastEvent,string,int) <IL 0x00015, 0x0011b>\r\n[MonoDroid] at Acr.UserDialogs.AbstractUserDialogs.WarnToast (string,int) <IL 0x00004, 0x00063>\r\n\r\n\r\nDo you think this is a bug with the latest version, or am I not initializing things they way I should be?\r\n"},"comment":{"url":"https://api.github.com/repos/aritchie/userdialogs/issues/comments/130310814","html_url":"https://github.com/aritchie/userdialogs/issues/48#issuecomment-130310814","issue_url":"https://api.github.com/repos/aritchie/userdialogs/issues/48","id":130310814,"user":{"login":"aritchie","id":1431555,"avatar_url":"https://avatars.githubusercontent.com/u/1431555?v=3","gravatar_id":"","url":"https://api.github.com/users/aritchie","html_url":"https://github.com/aritchie","followers_url":"https://api.github.com/users/aritchie/followers","following_url":"https://api.github.com/users/aritchie/following{/other_user}","gists_url":"https://api.github.com/users/aritchie/gists{/gist_id}","starred_url":"https://api.github.com/users/aritchie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aritchie/subscriptions","organizations_url":"https://api.github.com/users/aritchie/orgs","repos_url":"https://api.github.com/users/aritchie/repos","events_url":"https://api.github.com/users/aritchie/events{/privacy}","received_events_url":"https://api.github.com/users/aritchie/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T13:45:09Z","updated_at":"2015-08-12T13:45:09Z","body":"It will flush the full stack trace when the app shuts down.  If you don't see that, then catch the exception and write out the full content to the console"}}