diff --git a/OpenEdXMobile/src/main/java/org/edx/mobile/view/BaseCourseUnitVideoFragment.java b/OpenEdXMobile/src/main/java/org/edx/mobile/view/BaseCourseUnitVideoFragment.java index ba0d6de32f..ac2f3584c8 100644 --- a/OpenEdXMobile/src/main/java/org/edx/mobile/view/BaseCourseUnitVideoFragment.java +++ b/OpenEdXMobile/src/main/java/org/edx/mobile/view/BaseCourseUnitVideoFragment.java @@ -138,8 +138,10 @@ public abstract class BaseCourseUnitVideoFragment extends CourseUnitFragment } } // Only Allow handler to post the runnable when fragment is visible to user - if (getUserVisibleHint()) { + if (isVisible()) { subtitleDisplayHandler.postDelayed(this.subtitlesProcessorRunnable, SUBTITLES_DISPLAY_DELAY_MS); + } else { + updateClosedCaptionData(null); } }; @@ -217,8 +219,9 @@ private void initTranscripts() { initTranscriptListView(); updateTranscript(subtitlesObj); String subtitleLanguage = LocaleUtils.getCurrentDeviceLanguage(getActivity()); - if (!android.text.TextUtils.isEmpty(subtitleLanguage) && - getTranscriptModel().entrySet().contains(subtitleLanguage)) { + if (loginPrefs.getSubtitleLanguage() == null && + !android.text.TextUtils.isEmpty(subtitleLanguage) && + getTranscriptModel().containsKey(subtitleLanguage)) { loginPrefs.setSubtitleLanguage(subtitleLanguage); } showClosedCaptionData(subtitlesObj); diff --git a/OpenEdXMobile/src/main/java/org/edx/mobile/view/dialog/CCLanguageDialogFragment.java b/OpenEdXMobile/src/main/java/org/edx/mobile/view/dialog/CCLanguageDialogFragment.java index 623780f706..e6be0fe4df 100644 --- a/OpenEdXMobile/src/main/java/org/edx/mobile/view/dialog/CCLanguageDialogFragment.java +++ b/OpenEdXMobile/src/main/java/org/edx/mobile/view/dialog/CCLanguageDialogFragment.java @@ -73,13 +73,15 @@ public void onItemClicked(HashMap language) { HashMap hm; for(int i=0; i(); - hm.put(langList.keySet().toArray()[i].toString(), + hm.put(langList.keySet().toArray()[i].toString(), langList.values().toArray()[i].toString()); ccAdaptor.add(hm); } } String langSelected = getArguments().getString("selectedLanguage"); - + if (langSelected != null && !langList.containsKey(langSelected)) { + langSelected = langList.keySet().toArray()[0].toString(); + } ccAdaptor.selectedLanguage = langSelected; ccAdaptor.notifyDataSetChanged();