package com.example.uri01;

import android.os.Bundle;
import android.provider.MediaStore;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.database.Cursor;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;

public class MainActivity extends Activity {

   @SuppressLint("NewApi")
@Override
   public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      
      String filePath = "/mnt/sdcard/patoche";
      
      String[] retCol = { MediaStore.Audio.Media._ID };
      Cursor cur = getContentResolver().query(
          MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, 
          retCol, 
          MediaStore.MediaColumns.DATA + "='" + filePath + "'", null, null);
      if (cur.getCount() == 0) {
          return;
      }
      cur.moveToFirst();
      int id = cur.getInt(cur.getColumnIndex(MediaStore.MediaColumns._ID));
      cur.close();
      
      
      
      Cursor mediaCursor;
      
      mediaCursor = getContentResolver().query( MediaStore.Files.getContentUri("external"),
              null,
              MediaStore.Images.Media.DATA + " like ? ",
              new String[] {"%patoche%"},
              null);
      
      
      String tutu = "546";
   }
   
   
}