小编kil*_*ler的帖子

Xamarin Android无法绑定到服务Null指针

您好我正在使用Xamarin C#for Android.我试图用ListView构建一个Widget.

我移植的代码:https://github.com/Nailik/AppWidgetListView

首先我把它移植到C#:https: //laaptu.wordpress.com/2013/07/19/android-app-widget-with-listview/ (来源:https://github.com/laaptu/appwidget-listview/ tree/appwidget-listview1)

然后我做了这个改变:https://forums.xamarin.com/discussion/16930/app-widget-with-listview

现在我卡住了.每当我尝试将Widget添加到我的屏幕时,它只显示远程视图空视图并且因此错误而崩溃:

Java.Lang.RuntimeException: Unable to bind to service md5037fca43706e0b812912372d4076c895.WidgetService@3888bf9f with Intent { dat=intent: cmp=StimeApplication.StimeApplication/md5037fca43706e0b812912372d4076c895.WidgetService (has extras) }: java.lang.NullPointerException: Attempt to invoke interface method 'void android.widget.RemoteViewsService$RemoteViewsFactory.onCreate()' on a null object reference ---> Java.Lang.NullPointerException: Attempt to invoke interface method 'void android.widget.RemoteViewsService$RemoteViewsFactory.onCreate()' on a null object reference
  at --- End of managed exception stack trace ---
  at java.lang.NullPointerException: Attempt to invoke interface method …
Run Code Online (Sandbox Code Playgroud)

c# service android nullpointerexception xamarin

0
推荐指数
1
解决办法
383
查看次数

标签 统计

android ×1

c# ×1

nullpointerexception ×1

service ×1

xamarin ×1