Code example for Intent

Methods: setType

0
      } 
    } 
  } 
   
  public void pickMusic(View v) {
    Intent i=new Intent(Intent.ACTION_GET_CONTENT);
     
    i.setType("audio/*");
    startActivityForResult(i, PICK_REQUEST);
  } 
   
  public void playMusic(View v) {
    ClipData clip=clipboard.getPrimaryClip();
     
    if (clip==null) {
      Toast.makeText(this, "There is no clip!", Toast.LENGTH_LONG).show();
    } 
    else { 
      ClipData.Item item=clip.getItemAt(0);
      Uri song=item.getUri();
Contextual code suggestions in your IDE  Get Codota for Java