I have been searching a lot to find a way to do this. But nothing seems to be working for me. Can someone please help in doing this?
This is my image button for facebook status post:
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/hoributtons"
android:layout_alignTop="@+id/imageButton2"
android:background="#00000000"
android:contentDescription="@string/facebook"
android:onClick="shareOnFacebook"
android:src="@drawable/facebookbutton" />
This is my mainactivity.java file's corresponding part:
public class MainActivity extends FacebookActivity {
private static final String APP_ID = "xxxxxxxxxxxxx";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void shareOnFacebook(View v) {
//mfacebook = new Facebook("xxxxxxxxxxxxx");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
Can someone point in the right direction? :)
Here is details of variable that you can out in bundle
Bundle params = new Bundle();
And use AsyncFacebookRunner for post data to facebook :
The simplest way to post message on user`s wall who is successfully login using your android application is(my working code)_
for more please gone through Getting Started with the Facebook SDK for Android.
Assuming that you want to post on your own wall (since the question is not clear), this should work for you.
For details on posting pictures to wall, Facebook has a good documentation.