I cant solve error:resource drawable/abc (aka com.example.myapplication:drawable/abc) not found

bassel assad :

error: Android resource linking failed C:\Users\Bassel\AndroidStudioProjects\MyApplication\app\src\main\res\layout\activity_main.xml:31: error: resource drawable/abc (aka com.example.myapplication:drawable/abc) not found. error: failed linking file resources.

What is the abc file in the drawable which should be added until the error disappears

the file MainActivity.java

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
    public void onClickAddName(View view) {
        // Add a new student record
        ContentValues values = new ContentValues();
        values.put(StudentsProvider.NAME,
                ((EditText)findViewById(R.id.editText2)).getText().toString());

        values.put(StudentsProvider.GRADE,
                ((EditText)findViewById(R.id.editText3)).getText().toString());

        Uri uri = getContentResolver().insert(
                StudentsProvider.CONTENT_URI, values);

        Toast.makeText(getBaseContext(),
                uri.toString(), Toast.LENGTH_LONG).show();
    }
    public void onClickRetrieveStudents(View view) {
        // Retrieve student records
        String URL = "content://com.example.MyApplication.StudentsProvider";

        Uri students = Uri.parse(URL);
        Cursor c = managedQuery(students, null, null, null, "name");

        if (c.moveToFirst()) {
            do{
                Toast.makeText(this,
                        c.getString(c.getColumnIndex(StudentsProvider._ID)) +
                                ", " +  c.getString(c.getColumnIndex( StudentsProvider.NAME)) +
                                ", " + c.getString(c.getColumnIndex( StudentsProvider.GRADE)),
                        Toast.LENGTH_SHORT).show();
            } while (c.moveToNext());
        }
    }
}
virusarthak :

You don't have a problem with your MainActivity.java

Just put an image abc.png in your drawable folder,or else remove the line

 android:src="@drawable/abc"

and run the project.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=162067&siteId=1