Android R.java question.
From RegisterActivity
There's an error. The photo and the source code and source code. Please.
package com.example.happy.myapplication;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import android.R;
import android.R.*;
public class RegisterActivity extends AppCompatActivity {
private ArrayAdapter adapter;
private Spinner spinner;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register);
spinner = (Spinner) findViewById(R.id.majorSpinner);
adapter = ArrayAdapter.createFromResource(this. R.array.major, android.R.layout.simple_spinner_dropdown_item);
spinner .setAdapter(adapter);
}
}
Have you tried rebuilding project?
If you look at the import, the project's R file is not imported, but only the android.R file is imported. You must import the project's R file. The reason why the project's R file cannot be imported is because there is an error in the resource file in the res folder. Check the activity_register.xml file for errors~
714 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
546 Understanding How to Configure Google API Key
542 Unable to install versioned in Google Colab
548 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
547 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.