@Override protected void onCreate(Bundle arg0) { GKIMLog.lf(this, 1, TAG + "=>onCreate."); super.onCreate(arg0); uiHelper = new UiLifecycleHelper(this, callback); uiHelper.onCreate(arg0); if (TNPreferenceManager.getApplicationContext() == null) { TNPreferenceManager.setContext(this); } mTabletVersion = (getResources().getBoolean(R.bool.istablet)); if (getResources().getBoolean(R.bool.portrait_only)) { GKIMLog.lf(this, 0, TAG + "=>Not support for rotation"); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } Intent intent = this.getIntent(); if (intent != null) { // should pass to VideoStoryDetailFragment. String action = intent.getAction(); if (ACTION_STORY_VIEW.equalsIgnoreCase(action)) { // start story from PNS Bundle extra = intent.getExtras(); if (extra != null && extra.containsKey(DATA_KEY_STORY_JSON)) { String strjson = extra.getString(DATA_KEY_STORY_JSON); try { JSONObject jo = new JSONObject(strjson); if (jo.has(DATA_KEY_STORY_ID)) { mStoryId = jo.getString(DATA_KEY_STORY_ID); // mStoryChecked = false; mOpenedFromSectionId = TNPreferenceManager.EXTRAVALUE_SECTION_HOME; } } catch (Exception e) { GKIMLog.lf( null, 4, TAG + "=>Exception from parsing json string: " + strjson + ": " + e.getMessage()); } } } else if (intent.hasExtra(TNPreferenceManager.EXTRAKEY_IS_STORY) && intent.hasExtra(TNPreferenceManager.EXTRAKEY_STORYID)) { mStoryId = intent.getStringExtra(TNPreferenceManager.EXTRAKEY_STORYID); // mStoryChecked = intent.getBooleanExtra( // TNPreferenceManager.EXTRAKEY_IS_STORY_CHECKED, false); mOpenedFromSectionId = intent.getStringExtra(TNPreferenceManager.EXTRAKEY_OPEN_STORY_FROM_SECTION); mHasFromPNS = intent.getBooleanExtra(TNPreferenceManager.EXTRAKEY_OPEN_STORY_FROM_PNS, false); String storyIds = intent.getStringExtra(TNPreferenceManager.EXTRAKEY_STORYIDS_FROM_SECTION); if (storyIds != null && storyIds.length() > 0) { mListStoryIds = storyIds.split(","); // mNumberOfStories = mListStoryIds.length; } mStoryType = intent.getStringExtra(TNPreferenceManager.EXTRAKEY_STORY_FROM_VIDEO_SECTION); } } initLayout(); GKIMLog.lf(this, 0, TAG + "=>onCreate: " + mStoryId); mHashStoryCommentCount = new Hashtable<String, Integer>(); mHashStoryFBLikeCount = new Hashtable<String, Integer>(); if (DEBUG) { UIUtils.showToast(this, "starting Story: " + mStoryId); } if (mStoryId == null || mStoryId.length() <= 0) { this.finish(); } if (mListStoryIds == null || mListStoryIds.length <= 0) { mListStoryIds = new String[] {mStoryId}; } }