Skip to content

Commit feb689e

Browse files
committed
Using AlertDialog.setOnDismissListener() instead of AlertDialog.Builder's
Signed-off-by: Umair Khan <[email protected]>
1 parent 59308af commit feb689e

File tree

1 file changed

+9
-7
lines changed
  • App/src/main/java/in/ac/dtu/subtlenews

1 file changed

+9
-7
lines changed

App/src/main/java/in/ac/dtu/subtlenews/TTS.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,22 @@ public void onCreate(Bundle savedInstanceState) {
3737
tts.speak(text, TextToSpeech.QUEUE_FLUSH, null);
3838
AlertDialog summaryBox = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.AppTheme))
3939
.setMessage(text)
40-
.setOnDismissListener(new DialogInterface.OnDismissListener() {
41-
@Override
42-
public void onDismiss(DialogInterface dialogInterface) {
43-
finish();
44-
45-
}
46-
})
4740
.setOnCancelListener(new DialogInterface.OnCancelListener() {
4841
@Override
4942
public void onCancel(DialogInterface dialogInterface) {
5043
finish();
5144
}
5245
})
5346
.show();
47+
48+
summaryBox.setOnDismissListener(new DialogInterface.OnDismissListener() {
49+
50+
@Override
51+
public void onDismiss(DialogInterface dialogInterface) {
52+
finish();
53+
54+
}
55+
});
5456
TextView summaryText = (TextView) summaryBox.findViewById(android.R.id.message);
5557
summaryText.setTextSize(12);
5658

0 commit comments

Comments
 (0)