I am building an app where i am trying to play music in google play music by using sendBroadcast() but i am unable to play any of the song
music.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent i = getPackageManager().getLaunchIntentForPackage("com.google.android.music");
if (i != null) {
i.putExtra("command", "play");
Log.i("hjf","uefh");
sendBroadcast(i);
}
startActivity(i);
}
the logs being generated are
06-21 15:12:16.171 13805-13805/com.example.hp.ideaquestqualcomm D/ViewRootImpl: ViewPostImeInputStage processPointer 0
06-21 15:12:16.271 13805-13805/com.example.hp.ideaquestqualcomm D/ViewRootImpl: ViewPostImeInputStage processPointer 1
06-21 15:12:16.271 13805-13805/com.example.hp.ideaquestqualcomm I/hjf: uefh