Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我用 listView 制作 appWidget。为此,我需要使用 RemoteViews。当我初始化 appWidget ListView 时,我设置了适配器和空视图(没有内容时):
remoteViews.setEmptyView(R.id.listViewWidget, R.id.empty_view);
但是我的 emptyView 包含按钮,我需要为它设置 OnClickListener。我怎么能这样做?
你会需要setOnClickPendingIntent.
setOnClickPendingIntent
remoteviews.setOnClickPendingIntent(button_id, pendingIntent);
更多信息