1

我已经阅读了多个链接并尝试了各种方法但我无法让黑屏消失这里的任何建议是我的清单正在调用下一个活动和 xmls 的活动,代码

它基本上是一个启动屏幕,在 5 秒后它打开了两天前正在工作的另一个活动,昨晚我修复了一个逻辑错误,然后开始尝试将其恢复到我编辑它之前的方式,但在之后仍然是黑屏飞溅已显示。

显现

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.audiovolumecontrol"
android:versionCode="1"
android:versionName="1.0" >

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".Splash"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.example.audiovolumecontrol.Options"
        android:label="@string/options_name"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="VolumeControlMAIN"
        android:label="@string/app_name"
        android:screenOrientation="portrait" >
        <intent-filter>
            <action android:name=".com.example.audiovolumecontrol.VolumeControlMAIN" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
</application>

</manifest>

飞溅xml

<?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/splash_main2"
android:orientation="vertical" 

>

</LinearLayout>

启动代码

package com.example.audiovolumecontrol;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

public class Splash extends Activity 
{


     private static int LOGO_TIME_OUT = 5000;

@Override
protected void onCreate(Bundle savedInstanceState) 
{
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splash);


}

@Override
protected void onStart() 
{
    // TODO Auto-generated method stub
    super.onStart();


        new Handler().postDelayed(new Runnable() {

            @Override
            public void run() {
                Intent openSTART = new Intent                               
                            (Splash.this,VolumeControlMAIN.class);
                startActivity(openSTART); 
            }
        }, LOGO_TIME_OUT );






}

@Override
protected void onPause() {
    // TODO Auto-generated method stub
    super.onPause();
    finish();
}

}

帮助将不胜感激

我尝试了多种建议,但从将主题更改为 on start 方法和更改变量都没有奏效....这个程序以前有效,现在一旦我的启动画面出现并且时间到了,我只是得到一个黑屏

4

3 回答 3

0

你可以发布onCreate你的VolumeControlMAIN班级吗?如果您正在做很多工作onCreateVolumeControlMAIN那么在所有工作完成之前布局不会出现。

于 2013-11-09T12:48:22.213 回答
0

试试这个-->

        private static int LOGO_TIME_OUT = 3000;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);

        new Handler().postDelayed(new Runnable() {

        @Override
        public void run() {

            Intent i = new Intent(Splash.this,VolumeControlMAIN.class);
            startActivity(i);

            finish();
        }
    }, LOGO_TIME_OUT);

}

希望它可以帮助你.. :)

于 2013-09-07T21:17:06.213 回答
0

简单的!请按照以下 2 个步骤操作:(如果您使用的是 android 版本的 ICS)

  1. 只需转到设置/开发人员选项/窗口动画比例并将其关闭。
  2. 同样,只需转到设置/开发人员选项/过渡动画比例并将其关闭!
于 2013-11-09T12:25:09.987 回答