launch Spotify - Android App

Android examples for App:Popular App

Description

launch Spotify

Demo Code


import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import java.util.List;

public class Main{
    private static final String SPOTIFY_APP_PACKAGE = "com.spotify.music";
    public static void launchSpotify(Context context) {
        Intent intent = context.getPackageManager()
                .getLaunchIntentForPackage(SPOTIFY_APP_PACKAGE);
        if (intent != null) {
            /* we found the activity now start the activity */
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(intent);
        }//from   ww  w  . j a v a2s.c o  m
    }
}

Related Tutorials