android studio 出现程序包R不存在的问题该怎么解决,请各位大佬给我一个能用的解决方案,百度上找的方法发现都不能解决啊
AndroidMainfest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.R">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="用户登录界面"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Mainactivity.java
package com.example.myapplication;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
private boolean checked=false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
findViewById(R.id.btlogin).setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
login(view);
}
});
CheckBox checkBox=findViewById(R.id.checkBox);
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
checked=b;
}
});
}
public void login(View view){
EditText et_phone=findViewById(R.id.et_phone);
String loginName=et_phone.getText().toString();
checked=((CheckBox)findViewById(R.id.checkBox)).isChecked();
Toast.makeText(this,loginName+ "is login...Remmber is"+checked, Toast.LENGTH_SHORT).show();
}
}