如何在Android Widget中的RemoteViews中添加ListAdapter

时间:2013-07-05 08:53:05

标签: android

有人知道如何在RemoteViews中为小部件实现动态ListAdapter吗?甚至可能吗?

private static final String[] lists={"abc", "def", "ghi",
                                "jkl", "mno", "pqr",
                                "stu", "vwx", "xyz"};


@Override
public RemoteViews getViewAt(int position) {
RemoteViews row=new RemoteViews(ctxt.getPackageName(), R.layout.row);

row.setTextViewText(android.R.id.text1, lists[position]);

Intent i=new Intent();
Bundle extras=new Bundle();

extras.putString(WidgetProvider.EXTRA_WORD, lists[position]);
i.putExtras(extras);
row.setOnClickFillInIntent(android.R.id.text1, i);

return(row);

}

1 个答案:

答案 0 :(得分:0)

...是的,我们可以!见allowed classes。但我现在不怎么样。我也对代码snipplet感兴趣。