@Override
	public void executeDemo(final String text) {
		
		// Link if we need to
		FacebookUtils.linkForWrite(this, new SocializeAuthListener() {
			
			@Override
			public void onError(SocializeException error) {
				handleError(OpenGraphActivity.this, error);
			}
			
			@Override
			public void onCancel() {
				handleCancel();
			}
			
			@Override
			public void onAuthSuccess(SocializeSession session) {
				
				// This could be a custom Open Graph path in the form namespace:action
				final String graphPath = "me/og.likes";
				
				FacebookUtils.postEntity(OpenGraphActivity.this, entity, text, new SocialNetworkShareListener() {
					@Override
					public boolean onBeforePost(Activity parent, SocialNetwork socialNetwork, PostData postData) {
						
						// Add/Change the contents of the post to fit with open graph
						postData.setPath(graphPath);
						
						// Facebook like requires an "object" parameter
						postData.getPostValues().put("object", postData.getPropagationInfo().getEntityUrl());
						
						return false;
					}
					
					@Override
					public void onNetworkError(Activity context, SocialNetwork network, Exception error) {
						handleError(OpenGraphActivity.this, error);
					}
					
					@Override
					public void onCancel() {
						handleCancel();
					}
					
					@Override
					public void onAfterPost(Activity parent, SocialNetwork socialNetwork, JSONObject responseObject) {
						try {
							handleResult(responseObject.toString(4));
						}
						catch (JSONException e) {
							handleError(OpenGraphActivity.this, e);
						}
					}
				});
				
			}
			
			@Override
			public void onAuthFail(SocializeException error) {
				handleError(OpenGraphActivity.this, error);
			}
		});
	}
@Override
	public void executeDemo(final String text) {
		
		
		FacebookUtils.linkForWrite(this, new SocializeAuthListener() {
			
			@Override
			public void onError(SocializeException error) {
				handleError(OpenGraphActivity.this, error);
			}
			
			@Override
			public void onCancel() {
				handleCancel();
			}
			
			@Override
			public void onAuthSuccess(SocializeSession session) {
				
				
				final String graphPath = "me/og.likes";
				
				FacebookUtils.postEntity(OpenGraphActivity.this, entity, text, new SocialNetworkShareListener() {
					@Override
					public boolean onBeforePost(Activity parent, SocialNetwork socialNetwork, PostData postData) {
						
						
						postData.setPath(graphPath);
						
						
						postData.getPostValues().put("object", postData.getPropagationInfo().getEntityUrl());
						
						return false;
					}
					
					@Override
					public void onNetworkError(Activity context, SocialNetwork network, Exception error) {
						handleError(OpenGraphActivity.this, error);
					}
					
					@Override
					public void onCancel() {
						handleCancel();
					}
					
					@Override
					public void onAfterPost(Activity parent, SocialNetwork socialNetwork, JSONObject responseObject) {
						try {
							handleResult(responseObject.toString(4));
						}
						catch (JSONException e) {
							handleError(OpenGraphActivity.this, e);
						}
					}
				});
				
			}
			
			@Override
			public void onAuthFail(SocializeException error) {
				handleError(OpenGraphActivity.this, error);
			}
		});
	}
@ Override public void executeDemo ( final String text ) { // Link if we need to FacebookUtils . linkForWrite ( this , new SocializeAuthListener ( ) { @ Override public void onError ( SocializeException error ) { handleError ( OpenGraphActivity . this , error ) ; } @ Override public void onCancel ( ) { handleCancel ( ) ; } @ Override public void onAuthSuccess ( SocializeSession session ) { // This could be a custom Open Graph path in the form namespace:action final String graphPath = "me/og.likes" ; FacebookUtils . postEntity ( OpenGraphActivity . this , entity , text , new SocialNetworkShareListener ( ) { @ Override public boolean onBeforePost ( Activity parent , SocialNetwork socialNetwork , PostData postData ) { // Add/Change the contents of the post to fit with open graph postData . setPath ( graphPath ) ; // Facebook like requires an "object" parameter postData . getPostValues ( ) . put ( "object" , postData . getPropagationInfo ( ) . getEntityUrl ( ) ) ; return false ; } @ Override public void onNetworkError ( Activity context , SocialNetwork network , Exception error ) { handleError ( OpenGraphActivity . this , error ) ; } @ Override public void onCancel ( ) { handleCancel ( ) ; } @ Override public void onAfterPost ( Activity parent , SocialNetwork socialNetwork , JSONObject responseObject ) { try { handleResult ( responseObject . toString ( 4 ) ) ; } catch ( JSONException e ) { handleError ( OpenGraphActivity . this , e ) ; } } } ) ; } @ Override public void onAuthFail ( SocializeException error ) { handleError ( OpenGraphActivity . this , error ) ; } } ) ; }
/* (non-Javadoc)
@see com.socialize.demo.SDKDemoActivity#executeDemo(java.lang.String)
/ * ( non - Javadoc )