title: boolean issue on copy to SD, need some help to correct
body: <p>With a lot of help (on here) I've managed to nearly get my app up and running but I've got a problem. I'm basically a beginner in Java so this is a little deep for me, but I would still like some help. Basically the app displays a list of tones and lets you play them, if you touch and hold it inflates a context menu with an option to copy that selected tone to SD card. 
  The issue I know lies on the fourth-to-last line: <pre>boolean saved = saveas(sound.getSoundResourceId(),"filename");</pre> because the variable<pre>saved</pre> is not used.
  I'm not too sure how to fix this,or what i should put in place of <code>saved</code>, just wondering if anyone on here has a clue?
  Here's the full code:</p>
  
  <pre><code>public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);
  registerForContextMenu(getListView());
  this.getListView().setSelector(R.drawable.selector);
  //create a simple list
  mSounds = new ArrayList&lt;Sound&gt;();
  Sound s = new Sound();
  s.setDescription("Affirmative");
  s.setSoundResourceId(R.raw.affirmative);
  mSounds.add(s);
  s = new Sound();
  s.setDescription("Anjels");
  s.setSoundResourceId(R.raw.anjels);
  mSounds.add(s);
  s = new Sound();
  s.setDescription("Aggro");
  s.setSoundResourceId(R.raw.aggro);
  mSounds.add(s);
  mSounds.add(s);
  mAdapter = new SoundAdapter(this, R.layout.list_row, mSounds);
  setListAdapter(mAdapter);
  }
  @Override
  public void onListItemClick(ListView parent, View v, int position, long id){
  Sound s = (Sound) mSounds.get(position);
  MediaPlayer mp = MediaPlayer.create(this, s.getSoundResourceId());
  mp.start();
  
  }@Override
  public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
      super.onCreateContextMenu(menu, v, menuInfo);
      MenuInflater inflater = getMenuInflater();
      inflater.inflate(R.menu.context_menu, menu);
    }
  
  public boolean saveas(int ressound, String fName){  
      byte[] buffer=null;  
      InputStream fIn = getBaseContext().getResources().openRawResource(ressound);  
      int size=0;  
  
      try {  
       size = fIn.available();  
       buffer = new byte[size];  
       fIn.read(buffer);  
       fIn.close();  
      } catch (IOException e) {  
       // TODO Auto-generated catch block 
       return false;  
      }  
  
      String path="notifications/halon/"; 
      String filename=fName+".ogg";
      String baseDir = Environment.getExternalStorageDirectory().getAbsolutePath();
      String completePath = baseDir + File.separator + "music" + File.separator + "halon" + File.separator + filename;
  
  
      boolean exists = (new File(completePath)).exists();  
      if (!exists){new File(completePath).mkdirs();}  
  
      FileOutputStream save;  
      try {  
       save = new FileOutputStream(completePath);  
       save.write(buffer);  
       save.flush();  
       save.close();  
      } catch (FileNotFoundException e) {  
       // TODO Auto-generated catch block  
       return false;
      } catch (IOException e) {  
       // TODO Auto-generated catch block 
       return false;  
      }      
  
      sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.parse("file://"+path+filename)));  
  
      File k = new File(path, filename);  
  
      ContentValues values = new ContentValues();  
      values.put(MediaStore.MediaColumns.DATA, k.getAbsolutePath());  
      values.put(MediaStore.MediaColumns.TITLE, "exampletitle");  
      values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/ogg");  
      values.put(MediaStore.Audio.Media.ARTIST, "cssounds ");  
      values.put(MediaStore.Audio.Media.IS_RINGTONE, false);  
      values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);  
      values.put(MediaStore.Audio.Media.IS_ALARM, true);  
      values.put(MediaStore.Audio.Media.IS_MUSIC, false);  
  
      //Insert it into the database  
      this.getContentResolver().insert(MediaStore.Audio.Media.getContentUriForPath(k.getAbsolutePath()), values);  
  
      return true;  
     }
  @Override
  public boolean onContextItemSelected(MenuItem item) {
      AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
      Sound sound = (Sound) getListAdapter().getItem(info.position);
      int length = mSounds.size(); // get the length of mSounds object
      String[] names = new String[length]; // creates a fixed array with strings
      for(int i = 0; i &lt; length; i++) {
           // add sound name to string array
           names[i] = mSounds.get(i).getDescription(); // returns the string name
      }
      switch(item.getItemId()) {
      case R.id.copytosd:
            Toast.makeText(this, "Applying " + getResources().getString(R.string.copy) +
                        " for " + names[(int)info.id],
                        Toast.LENGTH_SHORT).show();
            boolean saved = saveas(sound.getSoundResourceId(),"filename");
            return true;
      default:
            return super.onContextItemSelected(item);
      }
  }}
  </code></pre>