【发布时间】:2016-12-20 07:30:06
【问题描述】:
我的应用程序中的启动画面不显示。仅显示白色背景。然后转到下一页。我在stackoverflow中看到了其他类似的问题,但它对我没有帮助。 飞溅.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/splash">
</RelativeLayout>
代码:
public class Splash extends AppCompatActivity {
@Override
protected void onCreate( Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Handler handler=new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
Intent intent=new Intent(Splash.this,MainActivity.class);
startActivity(intent);
Splash.this.finish();
}
},2000);
}
}
Manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.jobinsabu.ohxee">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".Splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity"></activity>
</application>
</manifest>
【问题讨论】:
-
发布您的
Manifest.xml -
好的。现在就做
-
包括清单。请查看
-
我认为您正在尝试加载大尺寸图像。 @drawable/飞溅。尝试一些其他图像而不是启动图像
-
好的。我现在试试
标签: android splash-screen