[英]Bundle savedInstanceState parcelable object is null=null when killing the app in background
[英]Bundle savedInstanceState null when Adding a widget to a existing Xamarin Android App
我有和現有的 Android應用程序與Xamarin開發。
它完美無缺。
我決定為我的應用程序創建一個小部件,然后我按照Xamarin Widget Sample , http://forums.xamarin.com/discussion/22941 ...和Vogela Widget教程指南來添加它所需要的內容。
不幸的是,因為他們的應用程序崩潰開始與此異常
Java.Lang.NullPointerException:嘗試在空對象引用上調用虛方法'void android.support.v7.widget.ContentFrameLayout.setId(int)'
問題來自於加載第一個活動並執行base.OnCreate (savedInstanceState);
Bundle savedInstanceState
為null。
我終於找到了自己的錯誤。 似乎xml文件夾在xamarin android上給出了一些錯誤。 我只是將contento移動到布局並將其作為layout/
而不是/xml
引用
這里提到的另一個解決方案
刪除Android項目上的
bin
和obj
文件夾並重建它
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.