From 168ac91ab8c25d5b47b4229aeffa6a3ef3e3c4dc Mon Sep 17 00:00:00 2001 From: John Zhen Mo Date: Thu, 18 Jan 2018 11:02:06 -0800 Subject: [PATCH] -Fixed toast exception on playlist creation. --- .../newpipe/fragments/local/PlaylistCreationDialog.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/fragments/local/PlaylistCreationDialog.java b/app/src/main/java/org/schabi/newpipe/fragments/local/PlaylistCreationDialog.java index 843b84de6..c43ba25b8 100644 --- a/app/src/main/java/org/schabi/newpipe/fragments/local/PlaylistCreationDialog.java +++ b/app/src/main/java/org/schabi/newpipe/fragments/local/PlaylistCreationDialog.java @@ -78,12 +78,13 @@ public class PlaylistCreationDialog extends DialogFragment { new LocalPlaylistManager(NewPipeDatabase.getInstance(getContext())); final List streams = Collections.singletonList(new StreamEntity(streamInfo)); + final Toast successToast = Toast.makeText(getActivity(), + "Playlist " + name + " successfully created", + Toast.LENGTH_SHORT); playlistManager.createPlaylist(name, streams) .observeOn(AndroidSchedulers.mainThread()) - .subscribe(longs -> Toast.makeText(getActivity(), - "Playlist " + name + " successfully created", - Toast.LENGTH_SHORT).show()); + .subscribe(longs -> successToast.show()); }); return dialogBuilder.create();