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() {
    public void handleMessage(Message msg) {
    switch (msg.what) {
    case STOPSPLASH:
    //remove SplashScreen from view
    Intent intent = new Intent(SplashScreen.this, jetpack.class);


    public void onCreate(Bundle savedInstanceState) {
    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=""
    android:layout_height="fill_parent" >
    <ImageView android:layout_width="fill_parent"
        android:src="@drawable/image" />

    and in the code add


    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


    You can use other themes as well


                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />

    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>

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


    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.