the classes you should import for just posting to facebook wall should be:
//the first two what you are looking for.
import com.facebook.Request;
import com.facebook.Request.Callback;
//the rest are important to complete the posting task
import com.facebook.RequestAsyncTask;
import com.facebook.Response;
import com.facebook.Session;
none of you have mentioned are Facebook class! did you add Facebook sdk to your project?
Update
here is a function I use everytime I want to post to user's timeline:
public static void postFB(final Context context, String message) {
final List<String> PERMISSIONS = Arrays.asList("publish_actions");
Session session = Session.getActiveSession();
if(session != null) {
List<String> permissions = session.getPermissions();
if(session.isOpened() && isSubset(PERMISSIONS, permissions)) {
Request request = Request.newStatusUpdateRequest(session, message, new Callback() {
@Override
public void onCompleted(Response response) {
// TODO Auto-generated method stub
FacebookRequestError error = response.getError();
if(error != null)
//show toast of the error
else
//show toast that it is posted
}
});
RequestAsyncTask task = new RequestAsyncTask(request);
task.execute();
}
}
}
isSubset function is used to check whether you have the permission to post or not:
public static boolean isSubset(Collection<String> subset, Collection<String> superset) {
for (String string : subset) {
if(!superset.contains(string))
return false;
}
return true;
}
just call this the Post method passing it the context and message...
you have to put in mind that you have already added the publish permission
when the user logged in...
as @gain1200 said, it is better to check the facebook documents here is a good example of how to set it up