Skip to content

Commit

Permalink
-Fixed toast exception on playlist creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
karyogamy committed Jan 20, 2018
1 parent 2ec25d8 commit 2a6a5f6
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,13 @@ public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
new LocalPlaylistManager(NewPipeDatabase.getInstance(getContext()));
final List<StreamEntity> 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();
Expand Down

0 comments on commit 2a6a5f6

Please sign in to comment.