private void handlePhotoPrivacySelection ( int photoPrivacyIndex , String albumName , String albumGraphPath ) { FacebookSettingsActivity activity = ( FacebookSettingsActivity ) getActivity ( ) ; if ( activity != null && ! activity . isFinishing ( ) ) { // Convert privacy index to privacy setting to store. String [ ] privacyArray = getResources ( ) . getStringArray ( R . array . wings_facebook_privacy__privacies ) ; String privacyString = privacyArray [ photoPrivacyIndex ] ; String photoPrivacy = null ; if ( getString ( R . string . wings_facebook__privacy__photo_privacy_self ) . equals ( privacyString ) ) { photoPrivacy = FacebookEndpoint . PHOTO_PRIVACY_SELF ; } else if ( getString ( R . string . wings_facebook__privacy__photo_privacy_friends ) . equals ( privacyString ) ) { photoPrivacy = FacebookEndpoint . PHOTO_PRIVACY_FRIENDS ; } else if ( getString ( R . string . wings_facebook__privacy__photo_privacy_friends_of_friends ) . equals ( privacyString ) ) { photoPrivacy = FacebookEndpoint . PHOTO_PRIVACY_FRIENDS_OF_FRIENDS ; } else if ( getString ( R . string . wings_facebook__privacy__photo_privacy_everyone ) . equals ( privacyString ) ) { photoPrivacy = FacebookEndpoint . PHOTO_PRIVACY_EVERYONE ; } // Set Facebook settings. if ( photoPrivacy != null && photoPrivacy . length ( ) > 0 && albumName != null && albumName . length ( ) > 0 && albumGraphPath != null && albumGraphPath . length ( ) > 0 ) { activity . mDestinationId = FacebookEndpoint . DestinationId . PROFILE ; activity . mPhotoPrivacy = photoPrivacy ; activity . mAlbumName = albumName ; activity . mAlbumGraphPath = albumGraphPath ; } else { activity . mHasErrorOccurred = true ; } // Finish activity. activity . tryFinish ( ) ; } }
Handles the photo privacy selection .