Source:
private Fragment getMainPageFramgent() { try { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); final String set_main_page = preferences.getString(getString(R.string.main_page_content_key), getString(R.string.main_page_selectd_kiosk_id)); if(set_main_page.equals(getString(R.string.blank_page_key))) { return new BlankFragment(); } else if(set_main_page.equals(getString(R.string.kiosk_page_key))) { int serviceId = preferences.getInt(getString(R.string.main_page_selected_service), 0); String kioskId = preferences.getString(getString(R.string.main_page_selectd_kiosk_id), "Trending"); KioskFragment fragment = KioskFragment.getInstance(serviceId, kioskId ); fragment.useAsFrontPage(true); return fragment; } else if(set_main_page.equals(getString(R.string.feed_page_key))) { FeedFragment fragment = new FeedFragment(); fragment.useAsFrontPage(true); return fragment; } else if(set_main_page.equals(getString(R.string.channel_page_key))) { int serviceId = preferences.getInt(getString(R.string.main_page_selected_service), 0); String url = preferences.getString(getString(R.string.main_page_selected_channel_url), "<LINK_0>"); String name = preferences.getString(getString(R.string.main_page_selected_channel_name), "Music"); ChannelFragment fragment = ChannelFragment.getInstance(serviceId, url, name); fragment.useAsFrontPage(true); return fragment; } else { return new BlankFragment(); } } catch (Exception e) { ErrorActivity.reportError(activity, e, activity.getClass(), null, ErrorActivity.ErrorInfo.make(UserAction.UI_ERROR, "none", "", R.string.app_ui_crash)); return new BlankFragment(); } }

Target:
private Fragment getMainPageFramgent() { try { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getActivity()); final String setMainPage = preferences.getString(getString(R.string.main_page_content_key), getString(R.string.main_page_selectd_kiosk_id)); if(setMainPage.equals(getString(R.string.blank_page_key))) { return new BlankFragment(); } else if(setMainPage.equals(getString(R.string.kiosk_page_key))) { int serviceId = preferences.getInt(getString(R.string.main_page_selected_service), FALLBACK_SERVICE_ID); String kioskId = preferences.getString(getString(R.string.main_page_selectd_kiosk_id), FALLBACK_KIOSK_ID); KioskFragment fragment = KioskFragment.getInstance(serviceId, kioskId ); fragment.useAsFrontPage(true); return fragment; } else if(setMainPage.equals(getString(R.string.feed_page_key))) { FeedFragment fragment = new FeedFragment(); fragment.useAsFrontPage(true); return fragment; } else if(setMainPage.equals(getString(R.string.channel_page_key))) { int serviceId = preferences.getInt(getString(R.string.main_page_selected_service), FALLBACK_SERVICE_ID); String url = preferences.getString(getString(R.string.main_page_selected_channel_url), FALLBACK_CHANNEL_URL); String name = preferences.getString(getString(R.string.main_page_selected_channel_name), FALLBACK_CHANNEL_NAME); ChannelFragment fragment = ChannelFragment.getInstance(serviceId, url, name); fragment.useAsFrontPage(true); return fragment; } else { return new BlankFragment(); } } catch (Exception e) { ErrorActivity.reportError(activity, e, activity.getClass(), null, ErrorActivity.ErrorInfo.make(UserAction.UI_ERROR, "none", "", R.string.app_ui_crash)); return new BlankFragment(); } }