Java Android Studio中的“R”问题
已经执行了清理项目、重建项目、分析和检查代码,但没有解决问题。这是从制作斜杠屏幕时开始的。我检查我的XML文件,这对我来说很好,但开始在每个Java类中实现。我创建了符号R。用红色下划线,尝试我能想到的一切Java Android Studio中的“R”问题,java,android,Java,Android,已经执行了清理项目、重建项目、分析和检查代码,但没有解决问题。这是从制作斜杠屏幕时开始的。我检查我的XML文件,这对我来说很好,但开始在每个Java类中实现。我创建了符号R。用红色下划线,尝试我能想到的一切 `package com.example.dom.myapp; import android.app.Activity; import android.content.Intent; import android.os.Bundle; public class Splashscreen e
`package com.example.dom.myapp;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
public class Splashscreen extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Thread timer = new Thread() {
public void run() {
try
{
sleep(4000);
}
catch (InterruptedException e)
{
e.printStackTrace();
}
finally
{
Intent myactivity = new Intent("com.example.dom.MAINACTIVITY");
startActivity(myactivity);
}
}
};
timer.start();
}
}`
这是我的飞溅布局
这是我的AndroidManifest
在splash布局中执行此操作
android:background=@+id/drawable/front必须是android:background=@drawable/front删除此@+id/ 看起来像这样:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/front"
>
</LinearLayout>
android:background=@+id/drawable/front必须是android:background=@drawable/front删除此@+id/
04-27 18:27:49.869 12888-12888/? E/Zygote: MountEmulatedStorage()
04-27 18:27:49.869 12888-12888/? E/Zygote: v2
04-27 18:27:49.879 12888-12888/? E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL
04-27 18:27:55.679 12888-12945/com.example.dom.myapp E/OpenGLRenderer: SFEffectCache:clear(), mSize = 0
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dom.myapp">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
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>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".ActivityOne"></activity>
<activity android:name=".ActivityTwo"></activity>
<activity android:name=".ActivityThree"></activity>
<activity android:name=".ActivityFour"></activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/front"
>
</LinearLayout>