2016-04-17 44 views
0

問題がありますか?Android(スプラッシュスクリーン)の黒い画面表示

私のアプリはソーシャルフォーラムアプリです。私がアプリにログインしようとするとき。スプラッシュ画面の後、黒い画面が表示されます。どのように私はこれを解決することができますか?

あなたは何を試しましたか?

  1. エミュレータで試してみると。それは時々動作しますが、私がログアウトしてログインしようとすると。黒い画面が表示されます。

  2. 私はスリープ時間(8000-9000-10000)を変更しました。時々動作しますが、私はユーザー名とパスワードでログインしようとすると黒い画面が表示されます。

  3. デバッグモードでエラーがなく、私もftpログを調べました。

  4. インターネット上で代替ソリューションを試しましたが、機能しませんでした。ここで

ここに私のスプラッシュ活動

package com.abulletin.forumapp.Activity; 
import android.app.Activity; 
import android.content.Intent; 
import android.os.Bundle; 
import com.abulletin.forumapp.R; 

public class SplashActivity extends Activity { 

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

     getActionBar().hide(); 

     Thread timerThread = new Thread(){ 
      public void run(){ 
       try{ 
        sleep(2000); 
       }catch(InterruptedException e){ 
        e.printStackTrace(); 
       }finally{ 
        Intent i = new Intent(getApplicationContext(),MainActivity.class); 
        startActivity(i); 
       } 
      } 
     }; 
     timerThread.start(); 
    } 

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

は私のマニフェストXMLは、あなたが質問をするが、多分それはのために助けることができるとき、それはしばらくしている

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.abulletin.forumapp" > 

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="android.permission.READ_PHONE_STATE" /> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="android.permission.VIBRATE" /> 
    <uses-permission android:name="android.permission.GET_ACCOUNTS" /> 
    <uses-permission android:name="android.permission.WAKE_LOCK" /> 
    <uses-permission android:name="android.permission.GET_TASKS" /> 
    <uses-permission android:name="android.permission.WRITE_SETTINGS" /> 
    <uses-permission android:name="com.mymonas.ngobrol.permission.C2D_MESSAGE" /> 
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 
    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" /> 
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> 

    <application 
     android:allowBackup="true" 
     android:icon="@drawable/ic_launcher" 
     android:label="@string/app_name" 
     android:name="com.abulletin.forumapp.MyApplication" 
     android:logo="@android:color/transparent" 
     android:theme="@style/Theme.Blue" > 
     <receiver 
      android:name="com.abulletin.forumapp.util.GcmBroadcastReceiver" 
      android:permission="com.google.android.c2dm.permission.SEND" > 
      <intent-filter> 
       <action android:name="com.google.android.c2dm.intent.RECEIVE" /> 
       <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> 

       <category android:name="com.mymonas.ngobrol.services" /> 
      </intent-filter> 
     </receiver> 

     <service android:name="com.abulletin.forumapp.util.GCMNotificationReceiver" /> 

     <activity 
      android:name="com.abulletin.forumapp.Activity.MainActivity" 
      android:label="@string/app_name" > 
     </activity> 

     <meta-data 
      android:name="com.google.android.gms.version" 
      android:value="@integer/google_play_services_version" /> 

     <activity 
      android:name="com.google.android.gms.ads.AdActivity" 
      android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" /> 

     <activity 
      android:name="com.abulletin.forumapp.Activity.LoginActivity" 
      android:label="@string/title_activity_login" > 
     </activity> 
     <activity 
      android:name="com.abulletin.forumapp.Activity.RegisterActivity" 
      android:label="@string/title_activity_register" > 
     </activity> 
     <activity 
      android:name="com.abulletin.forumapp.Activity.PostActivity" 
      android:label="@string/title_activity_post" > 
     </activity> 
     <activity android:name="com.abulletin.forumapp.Activity.ProfileActivity" > 
     </activity> 
     <activity 
      android:name="com.abulletin.forumapp.Activity.SettingsActivity" 
      android:label="@string/title_activity_settings" > 
     </activity> 
     <activity 
      android:name="com.abulletin.forumapp.Activity.AboutActivity" 
      android:label="@string/title_activity_about" > 
     </activity> 
     <activity android:name="com.abulletin.forumapp.Activity.CategoryThreadActivity" > 
     </activity> 
     <activity android:name="com.abulletin.forumapp.Activity.AddEditThreadActivity" > 
     </activity> 
     <activity 
      android:name="com.abulletin.forumapp.Activity.EditProfileActivity" 
      android:label="@string/profile_menu_edit" > 
     </activity> 

     <!-- <meta-data 
      android:name="com.crashlytics.ApiKey" 
      android:value="0ab64bea47ca3f35dffbd2c94200fbc26be26009" /> --> 

     <activity 
      android:name="com.abulletin.forumapp.Activity.SplashActivity" 
      android:configChanges="orientation|keyboardHidden|screenSize" 
      android:label="aBulletin Android Forum" 
      android:theme="@style/FullscreenTheme" > 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 

       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 

     <activity android:name="com.facebook.LoginActivity" 
      android:configChanges="orientation" 
      android:screenOrientation="landscape" 
      android:label="@string/app_name" 
      android:theme="@style/AppTheme" 
      /> 
     <meta-data android:name="com.facebook.sdk.ApplicationId" 
      android:value="@string/facebook_app_id"/> 

     <service android:name="com.parse.PushService" /> 

     <receiver android:name="com.parse.ParseBroadcastReceiver" > 
      <intent-filter> 
       <action android:name="android.intent.action.BOOT_COMPLETED" /> 
       <action android:name="android.intent.action.USER_PRESENT" /> 
      </intent-filter> 
     </receiver> 

    </application> 

</manifest> 
+0

'onPause'メソッドで' finish() 'を呼び出す特別な理由は何ですか? –

+0

ここと同じ理由。 [link](https://stackoverflow.com/questions/12655898/finish-and-the-activity-lifecycle)私はちょうどanroidのプログラミングを学んでいます。 どこが間違っていたと思いますか? –

+0

あなたは混乱するかもしれないと思います。 'onPause'メソッドで' finish() 'を呼び出すべきではありません。 –

答えて

0

です誰か。問題は、スプラッシュ画面に使用するイメージのためです。たぶんあなたはアンドロイドスタジオのアンドロイドモニターで見ることができますが、次のようなエラーがあります。

07-18 23:21:02.646 23482-23523/com.example.arslan.appphone W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (2880x5120, max=4096x4096) 

これは主な問題です。 Androidはその大きな画像でスプラッシュ画面を実行できません。

関連する問題