0

I've been programming with Android and have a Facebook login - Whenever my app starts up or is logging into Facebook it throws up this screen:

Image of loading-like screen

I've been unable to correctly name this screen nor have I been able to find it on Google.

I'm wishing to make changes to its design - Primarily change the action-bar as my apps actionbar doesn't have the logo nor the app name.

Does anyone know what this screen is called, and where I can find documentation on it?

I don't know if its relevant, but the spinning loading circle is only present when this screen shows via the Facebook login - The screen also shows if you start the app up after force stopping it but without the circle.

Community
  • 1
  • 1
Gareth Jones
  • 1,241
  • 4
  • 17
  • 38

1 Answers1

0

This "loading screen" is called a splash screen. This is a good stackoverflow on how to change your splash screen (important/key/needed steps listed below). It will also remove the action bar in the splash screen as well.

Key parts of link:

Add Splash Screen Image

First you need a splash screen image. Because Android devices come in various resolutions, you may want to ship several splash screens as described in Google's Best Practices for Supporting Multiple Screens. For simplicity, we'll just ship one here that is 480x800. It should support most phone sizes pretty well, and Android will scale it as best it can.

Add the the image/gif you want into your Resources\Drawable

You need to define the spash screen in your layout.xml file

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

          <ImageView id="@+id/splashscreen" android:layout_width="wrap_content"
                  android:layout_height="fill_parent"
                  android:src="@drawable/splash"
                  android:layout_gravity="center"/>

          <TextView android:layout_width="fill_parent"  <!-- Not needed->-->
                    android:layout_height="wrap_content"
                    android:text="Hello World, splash"/> <!--Not Needed -->

  </LinearLayout>

And your activity:

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

public class Splash extends Activity {

    /** Duration of wait **/
    private final int SPLASH_DISPLAY_LENGTH = 1000;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.splashscreen);

        /* New Handler to start the Menu-Activity 
         * and close this Splash-Screen after some seconds.*/
        new Handler().postDelayed(new Runnable(){
            @Override
            public void run() {
                /* Create an Intent that will start the Menu-Activity. */
                Intent mainIntent = new Intent(Splash.this,Menu.class);
                Splash.this.startActivity(mainIntent);
                Splash.this.finish();
            }
        }, SPLASH_DISPLAY_LENGTH);
    }
}
Community
  • 1
  • 1
Karma Hunter
  • 391
  • 2
  • 9
  • Awesome answer - I had never thought of it as a splash screen but it makes sense. I'll give it a go and mark this as the answer if it works. – Gareth Jones Oct 26 '14 at 00:29