2013-03-09 4 views
0

я получаю черный экран с именем приложения в момент запуска приложения в течение первого действия, как решить это пожалуйста предложить мне ..Черный экран во время запуска приложения

 I am getting black screen with application name at the time of launching application over the first activity how to resolve it please suggest me.. 

/** Вызывается, когда активность сначала создается. */

@Override 
public void onCreate(Bundle savedInstanceState) 
{ 

super.onCreate(savedInstanceState); 
ctx = this; 
setVolumeControlStream(AudioManager.STREAM_MUSIC); 
requestWindowFeature(Window.FEATURE_NO_TITLE); 


Intent i = getIntent(); 
if (null == i || null == i.getExtras() || 
    !i.getExtras().containsKey("levels")) { 

    activityCustomStarted = false; 
    setContentView(R.layout.main); 
    mGameView = (DroidGameView)findViewById(R.id.game); 
} else { 

    SharedPreferences sp = getSharedPreferences(
     FrozenDroid.PREFS_NAME, Context.MODE_PRIVATE); 
    int startingLevel = sp.getInt("levelCustom", 0); 
    int startingLevelIntent = i.getIntExtra("startingLevel", -2); 
    startingLevel = (startingLevelIntent == -2) ? 
        startingLevel : startingLevelIntent; 
    activityCustomStarted = true; 
    mGameView = new DroidGameView(this, i.getExtras().getByteArray("levels"), 
          startingLevel); 
    setContentView(mGameView); 
} 

mGameThread = mGameView.getThread(); 

if (savedInstanceState != null) { 
    mGameThread.restoreState(savedInstanceState); 
} 
mGameView.requestFocus(); 

setFullscreen(); 

}

XML является

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" > 

<com.shagunstudio.bubbleshoot.DroidGameView 
android:id="@+id/game" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" /> 

</FrameLayout> 

активность в menifest

<activity 
android:name="com.shagunstudio.bubbleshoot.FrozenDroid" 
android:alwaysRetainTaskState="true" 
android:configChanges="orientation|keyboard"`enter code here` 
android:label="@string/app_name" 
android:launchMode="singleInstance" 
android:screenOrientation="portrait" > 
<intent-filter> 
<action android:name="android.intent.action.FrozenDroid" /> 

<category android:name="android.intent.category.DEFAULT" /> 
</intent-filter> 
<intent-filter> 
<action android``:name="com.shagunstudio.bubbleshoot.GAME" /> 
<category android:name="android.intent.category.DEFAULT" /> 
</intent-filter> 
</activity> 
+2

Пожалуйста, внесите свой код здесь, чтобы мы могли вам помочь. –

ответ

0

Проверить OnCreate(), OnStart() и onResume() в своем коде, вы можете делать много времени, блокируя задачи. Загрузите тяжелые фоновые задания в отдельный поток.

Профилируйте свой код с помощью Traceview and dmtracedump, чтобы проверить, что занимает больше времени.

Смежные вопросы