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.java 内部public 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