Android 使用计时器获取活动之间的黑屏
我已经阅读了多个链接并尝试了各种方法,但我无法让黑屏消除任何建议。这里是我的清单,活动正在调用下一个活动和xmls,代码 它基本上是一个闪屏,5秒钟后它会打开另一个活动,两天前它正在工作,昨晚我修复了一个逻辑错误,然后它开始尝试恢复到编辑它之前的状态,但闪屏显示后仍然是一个黑屏 显示Android 使用计时器获取活动之间的黑屏,android,Android,我已经阅读了多个链接并尝试了各种方法,但我无法让黑屏消除任何建议。这里是我的清单,活动正在调用下一个活动和xmls,代码 它基本上是一个闪屏,5秒钟后它会打开另一个活动,两天前它正在工作,昨晚我修复了一个逻辑错误,然后它开始尝试恢复到编辑它之前的状态,但闪屏显示后仍然是一个黑屏 显示 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res
<?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>
我们将不胜感激
我尝试过多个建议,从改变主题到开始时的方法和改变变量,没有一个有效。。。。这个程序以前工作过,现在一旦我的闪屏显示出来,时间到了,我就会得到一个黑屏试试这个-->
}
希望它能帮助你:)简单!遵循以下两个步骤:(如果您使用的是android版本的ICS)
你能把你的
VolumeControlMAIN
类的onCreate
贴出来吗?如果你在onCreate
的VolumeControlMAIN
上做了大量的工作,那么在所有工作完成之前,布局不会出现。找到了类似的帖子和解决方案,谢谢,我想我明白了,我会尝试一下。我试过了,但在我的splash显示出我能做什么后,我仍然会得到这个黑屏。不幸的是,我是仍然被黑屏困住了我的舱单可能有问题吗?哦…:(事实上,我在本地创建了一个项目,并尝试了..它对我有效..在你的本地?本地类?你已经失去了我,巴德,我不知道本地机器是什么,如果我的项目完成了,有什么方法或事情可以尝试修复我的空白屏幕,但这个最终测试导致了这个问题,我真的需要完成它,我尝试了多种方法。)
<?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();
}
}
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);