Sto utilizzando l'SDK Android di Facebook e desidero chiudere la mia attività dopo che un utente effettua l'accesso e ottiene l'oggetto utente. In pratica sto conservando parti di esso, ma voglio chiudere l'attività a prescindere.call finish() dal metodo statico
// make request to the /me API
Request.executeMeRequestAsync(session, new Request.GraphUserCallback() {
// callback after Graph API response with user object
@Override
public void onCompleted(GraphUser user, Response response) {
if (user != null) {
finish(); // causes errors
}
}
});
Il messaggio di errore IDE finish()
è: "Cannot make a static reference to the non-static method finish() from the type Activity"
come procedere?
Prova 'getActivity(). Finish();' se hai un contesto, quindi 'context.getActivity.finish()' – Pragnani
hai provato questo http://stackoverflow.com/a/12025698/1218762? –
@Rstar ha funzionato come un fascino – CQM