我的一个分享按钮的是一个在ListView中弹出的popupWindow的LinearLayout布局,对其设置点击监听,点击的条目已经在getView()中获取了
LinearLayout llShare = (LinearLayout) contenview.findViewById(R.id.ll_share);
llShare.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent localIntent = new Intent("android.intent.action.SEND");
localIntent.setType("text/plain");
localIntent.putExtra("android.intent.extra.SUBJECT", "f分享");
localIntent.putExtra("android.intent.extra.TEXT","HI!推荐您使用软件:"+clickItem.getApkName());
startActivity(Intent.createChooser(localIntent,"分享"));
popupWindow.dismiss();
}
});
本文介绍了如何在Android应用中,通过ListView实现短信分享功能。点击ListView中的分享按钮,会弹出一个popupWindow,该布局包含一个LinearLayout。通过在getView()方法中设置监听,可以捕获用户选择的分享条目,从而触发短信分享操作。
514

被折叠的 条评论
为什么被折叠?



