Search in sources :

Example 1 with SocialLink

use of org.fossasia.openevent.data.extras.SocialLink in project open-event-android by fossasia.

the class MainActivity method storePageName.

private void storePageName(String feedType, String key) {
    if (SharedPreferencesUtil.getString(key, null) == null) {
        RealmList<SocialLink> socialLinks = event.getSocialLinks();
        RealmResults<SocialLink> page = socialLinks.where().equalTo("name", feedType).findAll();
        if (!page.isEmpty()) {
            SocialLink socialLink = page.get(0);
            String socialLinkUrl = socialLink.getLink();
            String tempString = ".com/";
            String pageName = socialLinkUrl.substring(socialLinkUrl.indexOf(tempString) + tempString.length()).replace("/", "");
            SharedPreferencesUtil.putString(key, pageName);
        }
    }
}
Also used : SocialLink(org.fossasia.openevent.data.extras.SocialLink)

Aggregations

SocialLink (org.fossasia.openevent.data.extras.SocialLink)1