Sunday, February 19, 2012

Hackbook App Requests


import android.os.Bundle;
import android.widget.Toast;

Bundle params = new Bundle();
params.putString("message", getString(R.string.request_message));
Utility.mFacebook.dialog(Hackbook.this, "apprequests", params, new AppRequestsListener());

public class AppRequestsListener extends BaseDialogListener {
        @Override
        public void onComplete(Bundle values) {
            Toast toast = Toast.makeText(getApplicationContext(), "App request sent",
                    Toast.LENGTH_SHORT);
            toast.show();
        }

        @Override
        public void onFacebookError(FacebookError error) {
            Toast.makeText(getApplicationContext(), "Facebook Error: " + error.getMessage(),
                    Toast.LENGTH_SHORT).show();
        }

        @Override
        public void onCancel() {
            Toast toast = Toast.makeText(getApplicationContext(), "App request cancelled",
                    Toast.LENGTH_SHORT);
            toast.show();
        }
    }

No comments: