Android小部件xamarin

时间:2016-12-28 16:21:14

标签: android xamarin widget

我创建了一个简单的小部件,当我尝试运行它时,我遇到了这种异常:

Parameter name: Type is not derived from a java type.(this, Java.Lang.Class.FromType (typeof (WordWidget)).Name

代码是:

[Service]
public class UpdateService : Service
{
    public override void OnStart (Intent intent, int startId)
    {
        RemoteViews updateViews = buildUpdate (this);
        ComponentName thisWidget = new ComponentName (this, Java.Lang.Class.FromType (typeof (WordWidget)).Name);
        AppWidgetManager manager = AppWidgetManager.GetInstance (this);
        manager.UpdateAppWidget (thisWidget, updateViews);
    }

0 个答案:

没有答案