Issue
In the above screenshot you can clearly see that I have created a raw folder with two files but when I do R.raw it says "cannot resolve raw".
here's all of my import statements:
package com.raunak.alarmdemo4.Activities;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.content.ContentValues;
import android.content.pm.ActivityInfo;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
import com.arbelkilani.clock.Clock;
import com.ebanx.swipebtn.OnStateChangeListener;
import com.ebanx.swipebtn.SwipeButton;
import com.raunak.alarmdemo4.HelperClasses.AlarmsDBhelperClass;
import com.raunak.alarmdemo4.R;
import java.io.IOException;
import java.util.Calendar;
import static com.raunak.alarmdemo4.R.*;
Solution
Try cleaning your project and building again. If this not work :
- Remove the import for the R.symbol, because probably you have imported R.class in your file, then click on the imported file and press ALT + Enter.
- If this also doesn't work then access it like this : your.project.package.R.raw .file_name
- Also try to remove the capital letter from the name of your audio.
Answered By - Elio Lako
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.