在Facebook上分享ListView项使用份额的意图选择器wallpost [英] Share Listview Item on Facebook wallpost using share intent chooser

查看:165
本文介绍了在Facebook上分享ListView项使用份额的意图选择器wallpost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从服务器获取数据,并将其设置为列表视图。每个ListView项有两个TextView的和一个按钮。我已经实现所有code和工作完美。但任何一个可以帮助我..如何实现Facebook共享意图时,点击列表视图特定的按钮item.I想用份额的意图选择器分享OFFER_NAME至Facebook的墙后

下面是我的getView code: -

 公共查看getView(INT位置,查看convertView,父母的ViewGroup){
    最后ViewHolder持有人;
    如果(convertView == NULL){
        持有人=新ViewHolder();
        convertView = mInflater.inflate(R.layout.offer_list_item,父母,
                假);
        holder.tv1 =(TextView中)convertView.findViewById(R.id.offer_name);
        holder.tv2 =(TextView中)convertView.findViewById(R.id.expiry_date);
        holder.b =(按钮)convertView.findViewById(R.id.item_button);
        convertView.setTag(保持器);
    }其他{
        支架=(ViewHolder)convertView.getTag();
    }
    项目1吧= item.get(位置);
    holder.tv1.setText(it.getoffer_name());
    holder.tv2.setText(要约结束:+ it.getexpiry_date());
    holder.b.setOnClickListener(新View.OnClickListener(){        @覆盖
        公共无效的onClick(视图v){
            // TODO自动生成方法存根
            // holder.b.setText(加入);
            // holder.b.setTextColor(Color.parseColor(#FFFFFF));
            // holder.b.setTextSize(10);
        }
    });
    返回convertView;
}


解决方案

首先你只能分享在Facebook涂鸦墙的链接。你不能发送任何pre填充的消息 - 这是对Facebook的政策

所有的第二你要坚持的指导方针,而不是强制用户使用特定共享信道(参考)

您可以过滤响应共享意图(例如在应用程序。<一个href=\"http://stackoverflow.com/questions/11752081/is-there-any-way-to-query-an-specific-type-of-intent-filter-capable-apps\">link)但请有记住,并非可以安装所有用户的Facebook。

所有的一切,我不认为这是一个好主意。

I am fetching data from server and set it into listview. Each Listview item have Two textview and a button. I have implemented all the code and working perfect.. But can any one help me.. How to implement facebook share intent when click on button of particular listview item.I want to share offer_name to facebook wall post using share intent chooser.

Here is my getView code :-

public View getView(int position, View convertView, ViewGroup parent) {
    final ViewHolder holder;
    if (convertView == null) {
        holder = new ViewHolder();
        convertView = mInflater.inflate(R.layout.offer_list_item, parent,
                false);
        holder.tv1 = (TextView) convertView.findViewById(R.id.offer_name);
        holder.tv2 = (TextView) convertView.findViewById(R.id.expiry_date);
        holder.b = (Button) convertView.findViewById(R.id.item_button);
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }
    Item1 it = item.get(position);
    holder.tv1.setText(it.getoffer_name());
    holder.tv2.setText("offer ends:" + it.getexpiry_date());
    holder.b.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            // holder.b.setText("Joined");
            // holder.b.setTextColor(Color.parseColor("#ffffff"));
            // holder.b.setTextSize(10);
        }
    });
    return convertView;
}

解决方案

First of all you can only share a link on a Facebook wall. You can't send any pre-filled messages - it is against Facebook policy.

Second of all you should stick to the guidelines and not force the user to use a specific share-channel (reference)

You could filter the Apps that respond to share Intent (e. g. link) but please have in mind that not all users can have Facebook installed.

All in all I don't think that this is a good idea.

这篇关于在Facebook上分享ListView项使用份额的意图选择器wallpost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆