Domanda

I want to open the Deezer Android Application from URI using Android Intent.

My code is:

try {
        uri = "deezer://track/"+track_id;
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
        activity.startActivity(intent);
    } catch (Exception e) {
        uri = "http://www.deezer.com/track/"+track_id;
        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
        activity.startActivity(intent);
    }

However, the URI "deezer://track/track_id is never detected by Deezer and doesn't work.

Anybody knows the correct URI syntax for that ?

(I use the same code for Spotify and it works with the URI: spotify:track:track_id)

È stato utile?

Soluzione

If you really want to use the deezer:// scheme, you can use the following uri :

  uri = "deezer://www.deezer.com/track/"+track_id;

Edit :

You can also use some query parameters to add behavior to your link, for instance the following uri : deezer://www.deezer.com/album/10596327?autoplay=true&start_index=13 will open the deezer app on the album's page immediately and will start playing with the 14th track (0 based index).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top