Ich habe eine einfache Demo-Anwendung mit einem Begrüßungsbildschirm eine Karte und einige normale Bildschirme entwickelt.Android: wie ActionBar auf bestimmte Aktivitäten zu verbergen
Ich habe eine Aktionsleiste an der Spitze, die ein Logo enthält. Auf meinem Handy sieht alles gut aus (Galaxy s1 I9000 V2.3), aber wenn ich es auf Galaxy s2 v4 teste, erscheint die Aktionsleiste auch im Begrüßungsbildschirm und auf dem Kartenbildschirm.
Die Spalsh- und Map-Aktivitäten erben nicht einmal von ActionBarActivity, also wie ist das möglich und wie kann ich es verschwinden lassen?
Manifest:
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:theme="@style/Theme.AppCompat.Light" >
<activity
android:name=".HomeActivity"
android:icon="@drawable/android_logo"
android:label=""
android:logo="@drawable/android_logo" >
<!--
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
-->
</activity>
<activity
android:name=".MapActivity"
android:label="" >
</activity>
<activity
android:name=".PackageActivity"
android:icon="@drawable/android_logo"
android:label=""
android:logo="@drawable/android_logo" >
</activity>
<activity
android:name=".SplashActivity"
android:label="" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
MapActivity Definition (es ist ein langer, so enthalten i nur die Definition):
public class MapActivity extends FragmentActivity implements LocationListener
Splash Aktivität:
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
public class SplashActivity extends Activity{
private static final long SPLASH_DISPLAY_LENGTH = 2000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
new Handler().postDelayed(new Runnable(){
@Override
public void run() {
Intent mainIntent = new Intent(SplashActivity.this,HomeActivity.class);
SplashActivity.this.startActivity(mainIntent);
SplashActivity.this.finish();
}
}, SPLASH_DISPLAY_LENGTH);
}
}
ich nicht 'getActionBar' verwenden kann, als die Aktivität nicht von' ActionBarActivity' erbt – Tomer
wenn i benutze '- false
' würde das nicht auf allen Bildschirmen versteckt? –
Tomer
Aktualisieren Sie meine Antwort, die für Ihre Bedürfnisse besser geeignet sein sollte. – Si8