How to show an image in full screen?

I want to make a splash screen in my application, for that i need to know how to show an image in full screen. This could me made by XML or Java code ? And how?
For now i just made this:

public class SplashScreen extends Activity {

    private static final int STOPSPLASH = 0;

    private static final long SPLASHTIME = 5000;



    private Handler splashHandler = new Handler() {
    @Override
    public void handleMessage(Message msg) {
    switch (msg.what) {
    case STOPSPLASH:
    //remove SplashScreen from view
    Intent intent = new Intent(SplashScreen.this, jetpack.class);
    startActivity(intent);
    break;
    }
    super.handleMessage(msg);
    }
    };



    @Override

    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splash_screen);
    Message msg = new Message();
    msg.what = STOPSPLASH;
    splashHandler.sendMessageDelayed(msg, SPLASHTIME);
    }
    }

How can be this splash_screen.xml ?
Thank you for your help.

  • How to send HTML email
  • Is there any way to get upload progress correctly with HttpUrlConncetion
  • commitAllowingStateLoss() in fragment activities
  • Nesting tabs in Android 4 with support library (ActionBarSherlock)
  • AVD Manager don't start
  • android - service stops when activity is destroyed
  • Related posts:

    Android Swipe View with Tabs Without Using the V4 support library
    Android. Avoid scaling of background
    TextView with different fonts and styles?
    How to create standard Borderless buttons (like in the design guidline mentioned)?
    AdMob orientation problem in Android
    Spinner with on Click Listener
  • Successful share intent for android
  • Android: How to make all elements inside LinearLayout same size?
  • android:inputType=“textEmailAddress” - '@' key and a '.com' key?
  • Resizing surface view for aspect ratio change in video display in android
  • “The prefix ”xliff“ for element ”xliff:g“ is not bound”
  • Screen orientation and values in manifest.xml
  • 3 Solutions collect form web for “How to show an image in full screen?”

    <?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 android:layout_width="fill_parent"
        android:layout_height="fill_parent" 
        android:src="@drawable/image" />
    </LinearLayout>
    

    and in the code add

    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    

    before setContentView(R.layout.splash_screen);

    The best way to show a full screen splash activity is by putting this line in your manifest under activity tag

    android:theme=”@android:style/Theme.Light.NoTitleBar.Fullscreen”

    You can use other themes as well

    Theme.Black.NoTitleBar.Fullscreen
    Theme.NoTitleBar.Fullscreen

    <activity
            android:name="com.example.SplashActivity"
            android:label="@string/app_name" 
            android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    

    For Latest Api Lollipop and above

    <style name="Theme.AppCompat.Light.NoActionBar.FullScreen" parent="@style/Theme.AppCompat.Light">
    <item name="windowNoTitle">true</item>
    <item name="windowActionBar">false</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
    </style>
    

    Define this theme for the splash activity and provide it in manifest

    android:theme=”@style/Theme.AppCompat.Light.NoActionBar.FullScreen”

    If R.layout.splash_screen included an image with height and width set to fill_parent or match_parent (depending on version). It will fill the screen

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.