Skip to content

Commit

Permalink
[android] avoid crash NavUtils.openArtistProfile()
Browse files Browse the repository at this point in the history
  • Loading branch information
gubatron committed Feb 5, 2016
1 parent 0faaf64 commit 044263f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions android/apollo/src/com/andrew/apollo/utils/NavUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public final class NavUtils {
*/
public static void openArtistProfile(final Activity context,
final String artistName) {
if (artistName == null || artistName.isEmpty()) {
return;
}

// Create a new bundle to transfer the artist info
final Bundle bundle = new Bundle();
Expand Down Expand Up @@ -115,9 +118,6 @@ public static void openSettings(final Activity activity) {
*/
public static void openAudioPlayer(final Activity activity) {
final Intent intent = new Intent(activity, AudioPlayerActivity.class);
//intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
//intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
//intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
activity.startActivity(intent);
activity.finish();
Expand Down

0 comments on commit 044263f

Please sign in to comment.