0

I am developing an application that will play Youtube videos. My need is that when a user types any keyword that related videos for the keyword need to be displayed. However it seems that currently no matter what keyword is typed, when executed the response contains only videos about 'android'. If anyone know how to solve this, I would appreciate some help. Below is my code:

public void searchData(View v) {
    ev = (EditText) findViewById(R.id.editText1);
    if (v.getId() == R.id.button1) {
        String appPackageName = getPackageName();
        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);
    }
}
4

2 に答える 2