Search a specific string in Youtube application from my app

前端 未结 1 1476
借酒劲吻你
借酒劲吻你 2021-02-09 17:15

I have a button that when i tap on it i want to invoke Youtube app and search for predefined string(the search string is constant, i mean that Youtube app will display automatic

1条回答
  •  感情败类
    2021-02-09 18:07

    try this Intent For Search on Youtube :

     Intent intent = new Intent(Intent.ACTION_SEARCH);
     intent.setPackage("com.google.android.youtube");
     intent.putExtra("query", "Android");
     intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
     startActivity(intent);
    

    0 讨论(0)
提交回复
热议问题