I am trying to create a small app that posts the entries made by an user in my app to facebook when they press the back button to quit. I already have SSO and everything else set up, the problem is it does not recognize PostDialogListener as a valid listener. Says does not exist, the code where I am trying to use it
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK)) {
Log.d(this.getClass().getName(), "back button pressed");
fb.dialog(getApplicationContext(), "stream.publish", new PostDialogListener());
Toast t=Toast.makeText(getApplicationContext(), " Back pressed ", Toast.LENGTH_LONG);
t.show();
}
return super.onKeyDown(keyCode, event);
}
I tried putting the dialog code in other places too, but same result, PostDialogListener is not being recognized.
You probably don’t import it from example. Add these classes to your project: