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.

  • Service vs IntentService
  • Installing APK from email attachment
  • Published Android apk gives error “Package file was not signed correctly”
  • jquery ajax GET request executing twice
  • Detect my app's own android:versionCode at run time
  • How can I hide the zoom control in an Android webview?
  • Android widget different portrait and landscape orientation
  • android custom EditText UI
  • Using the colors for the new Material design theme in Android
  • Obfuscate private fields using ProGuard
  • android illegal exception when dialog is showing
  • Android ndk-build ignoring APP_ABI := x86
  • 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.