@Override
	public void handle(final Activity context, final SocializeAction action, Location location, final String text, final SocialNetworkListener listener) {
        ShareType shareType = getShareType();
        final SocialNetwork network = SocialNetwork.valueOf(shareType);
		PropagationInfoResponse propagationInfoResponse = action.getPropagationInfoResponse();
		
		if(propagationInfoResponse != null) {
			final PropagationInfo propagationInfo = propagationInfoResponse.getPropagationInfo(shareType);
			
			if(propagationInfo != null) {
				try {
                    if(loopyService.isLoopyEnabled()) {

                        if(shareType.equals(ShareType.OTHER)) {
                            loopyService.showShareDialog(context, "", text, action.getEntity(), propagationInfo, listener);
                        } else {
                            loopyService.getTrackableUrl(action.getEntity(), shareType, propagationInfo.getEntityUrl(), new ShareCallback() {
                                @Override
                                public void onResult(Item item, Throwable error) {

                                    PropagationInfo infoInUse = loopyService.setShortlinks(propagationInfo, item, error);

                                    try {
                                        handle(context, action, text, infoInUse, listener);
                                    } catch (Exception e) {
                                        if(logger != null) {
                                            logger.error("Error handling share", e);
                                        }

                                        if(listener != null) {
                                            listener.onNetworkError(context, network, e);
                                        }
                                    }
                                }
                            });
                        }
                    } else {
                        handle(context, action, text, propagationInfo, listener);
                    }
				}
				catch (Exception e) {
					if(logger != null) {
						logger.error("Error handling share", e);
					}

					if(listener != null) {
						listener.onNetworkError(context, network, e);
					}
				}
			}
			else {
				logError(context, network, "No propagation info found for type [" +
                        shareType +
								"].  Share will not propagate", listener);
			}
		}
		else {
			logError(context, network, "No propagation info found for type [" +
                    shareType +
							"].  Share will not propagate", listener);
		}
	}
@Override
	public void handle(final Activity context, final SocializeAction action, Location location, final String text, final SocialNetworkListener listener) {
        ShareType shareType = getShareType();
        final SocialNetwork network = SocialNetwork.valueOf(shareType);
		PropagationInfoResponse propagationInfoResponse = action.getPropagationInfoResponse();
		
		if(propagationInfoResponse != null) {
			final PropagationInfo propagationInfo = propagationInfoResponse.getPropagationInfo(shareType);
			
			if(propagationInfo != null) {
				try {
                    if(loopyService.isLoopyEnabled()) {

                        if(shareType.equals(ShareType.OTHER)) {
                            loopyService.showShareDialog(context, "", text, action.getEntity(), propagationInfo, listener);
                        } else {
                            loopyService.getTrackableUrl(action.getEntity(), shareType, propagationInfo.getEntityUrl(), new ShareCallback() {
                                @Override
                                public void onResult(Item item, Throwable error) {

                                    PropagationInfo infoInUse = loopyService.setShortlinks(propagationInfo, item, error);

                                    try {
                                        handle(context, action, text, infoInUse, listener);
                                    } catch (Exception e) {
                                        if(logger != null) {
                                            logger.error("Error handling share", e);
                                        }

                                        if(listener != null) {
                                            listener.onNetworkError(context, network, e);
                                        }
                                    }
                                }
                            });
                        }
                    } else {
                        handle(context, action, text, propagationInfo, listener);
                    }
				}
				catch (Exception e) {
					if(logger != null) {
						logger.error("Error handling share", e);
					}

					if(listener != null) {
						listener.onNetworkError(context, network, e);
					}
				}
			}
			else {
				logError(context, network, "No propagation info found for type [" +
                        shareType +
								"].  Share will not propagate", listener);
			}
		}
		else {
			logError(context, network, "No propagation info found for type [" +
                    shareType +
							"].  Share will not propagate", listener);
		}
	}
@ Override public void handle ( final Activity context , final SocializeAction action , Location location , final String text , final SocialNetworkListener listener ) { ShareType shareType = getShareType ( ) ; final SocialNetwork network = SocialNetwork . valueOf ( shareType ) ; PropagationInfoResponse propagationInfoResponse = action . getPropagationInfoResponse ( ) ; if ( propagationInfoResponse != null ) { final PropagationInfo propagationInfo = propagationInfoResponse . getPropagationInfo ( shareType ) ; if ( propagationInfo != null ) { try { if ( loopyService . isLoopyEnabled ( ) ) { if ( shareType . equals ( ShareType . OTHER ) ) { loopyService . showShareDialog ( context , "" , text , action . getEntity ( ) , propagationInfo , listener ) ; } else { loopyService . getTrackableUrl ( action . getEntity ( ) , shareType , propagationInfo . getEntityUrl ( ) , new ShareCallback ( ) { @ Override public void onResult ( Item item , Throwable error ) { PropagationInfo infoInUse = loopyService . setShortlinks ( propagationInfo , item , error ) ; try { handle ( context , action , text , infoInUse , listener ) ; } catch ( Exception e ) { if ( logger != null ) { logger . error ( "Error handling share" , e ) ; } if ( listener != null ) { listener . onNetworkError ( context , network , e ) ; } } } } ) ; } } else { handle ( context , action , text , propagationInfo , listener ) ; } } catch ( Exception e ) { if ( logger != null ) { logger . error ( "Error handling share" , e ) ; } if ( listener != null ) { listener . onNetworkError ( context , network , e ) ; } } } else { logError ( context , network , "No propagation info found for type [" + shareType + "].  Share will not propagate" , listener ) ; } } else { logError ( context , network , "No propagation info found for type [" + shareType + "].  Share will not propagate" , listener ) ; } }
/* (non-Javadoc)
@see com.socialize.share.ShareHandler#handle(android.app.Activity, com.socialize.entity.Share, com.socialize.share.ShareHandlerListener)
/ * ( non - Javadoc )