Code example for Intent

Methods: getData

0
  protected void onActivityResult(int requestCode, int resultCode,
                                    Intent data) {
    if (requestCode==PICK_REQUEST) {
      if (resultCode==RESULT_OK) {
        ClipData clip=ClipData.newUri(getContentResolver(),
                                       "Some music", data.getData());
         
        clipboard.setPrimaryClip(clip);
      } 
    } 
  } 
   
  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) {
Stop searching for code, let great code find you!  Add Codota to your java IDE