Android: Getting cannot be resiolved to a typr when trying to use RingtunesstarwarsActivity class
<p>I created a test project with a methed called  testringtone(), that sets a ringtones.  It ran fine.  When I copied this method in another project, I get a error thats says RingtunesstarwarsActivity cannot be resolved to a type, the line is
    <code>RingtunesstarwarsActivity.this.getPackageName()+  "/" + "raw/blasters";
    Uri mUri = Uri.parse(strUri);</code>.</p>

<p>This works fine in my test project.
complete</p>

<blockquote>
  <p>method  void    testringtone()
      {
            File newSoundFile = new File("/sdcard/", "myringtone.oog");</p>
</blockquote>

<pre><code>ERROR HERE /////////////////////////////////////////////////// 


String strUri = "android.resource://"+




 RingtunesstarwarsActivity.this.getPackageName()+  "/" + "raw/blasters";
Uri mUri = Uri.parse(strUri);
/////////////////////////////

ContentResolver mCr = getContentResolver();
AssetFileDescriptor soundFile;
try {
       soundFile= mCr.openAssetFileDescriptor(mUri, "r");
   } catch (FileNotFoundException e) {
       soundFile=null;   
   }

   try {
      byte[] readData = new byte[1024];
      FileInputStream fis = soundFile.createInputStream();
      FileOutputStream fos = new FileOutputStream(newSoundFile);
      int i = fis.read(readData);

      while (i != -1) {
        fos.write(readData, 0, i);
        i = fis.read(readData);
      }

      fos.close();
   } catch (IOException io) {
   }

//////////////////////////////////////////


  ContentValues values = new ContentValues();
       values.put(MediaStore.MediaColumns.DATA, newSoundFile.getAbsolutePath());
       values.put(MediaStore.MediaColumns.TITLE, "my ringtone");
       values.put(MediaStore.MediaColumns.MIME_TYPE, "audio/oog");
       values.put(MediaStore.MediaColumns.SIZE, newSoundFile.length());
       values.put(MediaStore.Audio.Media.ARTIST, R.string.app_name);
       values.put(MediaStore.Audio.Media.IS_RINGTONE, true);
       values.put(MediaStore.Audio.Media.IS_NOTIFICATION, true);
       values.put(MediaStore.Audio.Media.IS_ALARM, true);
       values.put(MediaStore.Audio.Media.IS_MUSIC, false);

   Uri uri = MediaStore.Audio.Media.getContentUriForPath(newSoundFile.getAbsolutePath());
   Uri newUri = mCr.insert(uri, values);


   try {
       RingtoneManager.setActualDefaultRingtoneUri(this, RingtoneManager.TYPE_RINGTONE, newUri);
   } catch (Throwable t) {
    //   Log.d(TAG, "catch exception");
   }

///////////////////////////////////////   

} // end methed
</code></pre>
