0
I am using the TTS in my Activity. I Want the tts dialog appear only one time.
- 예를 들어 대화 선택 화면에서 내가 피코 TTS를 선택한다고 가정 촬영. 다음에이 활동을 열 때. 나는 다음에 열리길 원하지 않는다.
I am using the TTS in my Activity. I Want the tts dialog appear only one time.
당신은 sharedpreference를 사용할 수있다. 사용하려는 TTS를 선택할 때 true로 설정되고 공유 환경 설정에 저장되는 부울을 정의한다고 가정합니다. 다음 번에 앱을 실행하면 해당 부울 값을 확인하고 false 일 경우에만 대화 상자를 시작해야합니다.
예 :
private SharedPreferences preferences;
private String PREFS_NAME = "com.example.stackoverflow";
private String PREFS_CHECK = "com.example.stackoverflow.check";
private Boolean check;
preferences = this.getSharedPreferences(PREFS_NAME,MODE_PRIVATE);
check = preferences.getInt(PREFS_CHECK_STATS,false);
if(check){
.
.
.
}else{
.
.
.
preferences.edit().putBoolean(PREFS_CHECK,true).commit(); //Here you set the value.
}