1

ListView在每个项目里面都有一个我有一个 facebook 分享按钮

<com.facebook.share.widget.ShareButton
    android:id="@+id/btnOne"
    android:layout_centerInParent="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_margin="5dp" />

但是当我点击里面的按钮 MediaAdapter.javapublic View getView(final int position, View convertView, ViewGroup parent)

holder.button = (Button) v.findViewById(R.id.btnOne);
holder.button.setOnClickListener(new View.OnClickListener() { 
    @Override 
    public void onClick(View v) {
        v.setTag(holder);        
        Drawable mDrawable =  holder.imageview.getDrawable();
        Bitmap image = ((BitmapDrawable)mDrawable).getBitmap();

        SharePhoto photo = new SharePhoto.Builder()
                        .setBitmap(image)
                        //.setCaption("Give me my codez or I will ... you know, do that thing you don't like!")
                         .build();

        SharePhotoContent content = new SharePhotoContent.Builder()
                         .addPhoto(photo)
                         .build();

        ShareApi.share(content, null);  

    }   

});

我收到此错误:

在此处输入图像描述

4

0 回答 0