• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Posting a Text Status using Facebook API in Android - The simplest method

0 down vote favorite


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:

This is my mainactivity.java file's corresponding part:

[HIGH]public class MainActivity extends FacebookActivity {

private static final String APP_ID = "XXXXXXXXXXXXXXX";

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

. . . . . . .

public void shareOnFacebook(View v) {
//mfacebook = new Facebook("XXXXXXXXXXXXXXX");
postOnWall("Testing from Android");
}

@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;
}
}[/HIGH]Can someone point in the right direction? :)
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones