我创建了一个简单的小部件,当我尝试运行它时,我遇到了这种异常:
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);
}