给每个控件添加一个PendingIntent,这个样子就搞定了。
Intent Nextintent=new Intent("apai.widget.Next");
Intent Preintent=new Intent("apai.widget.Pre");
Intent Detailintent=new Intent(context,NewsDetail.class);//new Intent("apai.widget.Detail");
PendingIntent pendingIntentNext=PendingIntent.getBroadcast(context, 0, Nextintent, 0);
PendingIntent pendingIntentPre=PendingIntent.getBroadcast(context, 0, Preintent, 0);
PendingIntent pendingIntentDetail = PendingIntent.getActivity(context, 0, Detailintent, 0);
views.setOnClickPendingIntent(R.id.ImageButton01, pendingIntentPre);
views.setOnClickPendingIntent(R.id.ImageButton02, pendingIntentNext);
views.setOnClickPendingIntent(R.id.TextView01,pendingIntentDetail);
---------------------------------------------------------
专注移动开发
Android, Windows Mobile, iPhone, J2ME, BlackBerry, Symbian
posted on 2010-05-20 09:32
TiGERTiAN 阅读(1433)
评论(0) 编辑 收藏 所属分类:
Android