相关疑难解决方法(0)

StackView Widget示例源代码

请提供StackView Widget示例源代码.http://developer.android.com/resources/samples/StackWidget/index.html重定向到示例链接http://developer.android.com/tools/samples/index.html.

Sample链接表明该示例可以在"/ samples/android- /"文件夹下找到.但我没有在我的Windows 7 PC中从api级别11到16在这些文件夹下找到任何样本.

App小部件部分,经常引用这个示例项目,但遗憾的是我找不到源代码.请帮帮我.

android android-widget

26
推荐指数
3
解决办法
3万
查看次数

如何传递数据并从Widget中打开一个Activity?[Android]产品

在我ListProvider实现的类中,RemoteViewsFactory我已经在下面编写了以下代码:

@Override
public RemoteViews getViewAt(int position) {
    RemoteViews rv = new RemoteViews(mContext.getPackageName(), R.layout.list_row);

rv.setTextViewText(R.id.heading, merch_name);
        rv.setTextViewText(R.id.content, teaser);

        Bundle extras = new Bundle();
        extras.putInt(WidgetProvider.EXTRA_ITEM, position);
        extras.putString(WidgetProvider.MERCHANT_ITEM, mWidgetItems.get(position).merchant_id);


        Intent fillInIntent = new Intent();
        fillInIntent.putExtras(extras);
        rv.setOnClickFillInIntent(R.id.llRow, fillInIntent);

  return rv;
}
Run Code Online (Sandbox Code Playgroud)

当我点击时,我把Logs in my onReceiveof WidgetProviderit中有正确的ID,但是在打开活动后它没有正确的ID放在哪里extras.还有时间,它没有打开Activity我提供的,只是打开我的MainActivity.当我从中删除我的应用程序recently open app然后使用时,会发生这种情况widget.

这里是我的代码onReceive在我WidgetProvider

 public class WidgetProvider extends AppWidgetProvider {

 public static final String TOAST_ACTION = "my.packagename.TOAST_ACTION";
public static final …
Run Code Online (Sandbox Code Playgroud)

android listview widget

9
推荐指数
1
解决办法
1281
查看次数

标签 统计

android ×2

android-widget ×1

listview ×1

widget ×1