Skip to content
This repository has been archived by the owner on Aug 3, 2019. It is now read-only.

Get page

Roman Kushnarenko edited this page Jun 20, 2015 · 2 revisions

Two options are possible to get page data.

Default

Initialize callback listener:

OnPageListener onPageListener = new OnPageListener() {			
	@Override
	public void onComplete(Page page) {
		Log.i(TAG, "Page id = " + page.getId());
	}

	/* 
	 * You can override other methods here: 
	 * onThinking(), onFail(String reason), onException(Throwable throwable)
	 */		
};

Get the page:

String pageId = ... ;
mSimpleFacebook.getPage(pageId, onPageListener);

Be specific and get what you need

By using this option, you define the properties you need, and you will get only them. Here, any property is possible to get.

Prepare the properties that you need:

Page.Properties properties = new Page.Properties.Builder()
	.add(Page.Properties.ID)
	.add(Page.Properties.NAME)
	.add(Page.Properties.LINK)
	.build();

Get the page:

String pageId = ...	;
mSimpleFacebook.getPage(pageId, properties, onPageListener);
Clone this wiki locally