Skip to content

Instantly share code, notes, and snippets.

@surfjedi
Last active December 16, 2015 20:29
Show Gist options
  • Save surfjedi/5493327 to your computer and use it in GitHub Desktop.
Save surfjedi/5493327 to your computer and use it in GitHub Desktop.
Phone Gap 2.6.0 android [your_app_name].java. With: 1.timed splash screen 2. hidden status bar
package com.[your_company_name].[your_app_name];
import android.os.Bundle;
import org.apache.cordova.*;
import android.view.WindowManager;
public class [your_app_name] extends DroidGap
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.setIntegerProperty("splashscreen", R.drawable.splash);
// Set by <content src="index.html" /> in config.xml
super.loadUrl(Config.getStartUrl(), 5000);
//super.loadUrl("file:///android_asset/www/index.html")
//Full screen
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
}
}
@surfjedi
Copy link
Author

surfjedi commented May 1, 2013

Also you need to have:

android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"

in your application Minfest file in the activity section.

<application android:icon="@drawable/icon" android:label="@string/app_name"
    android:hardwareAccelerated="true"
    android:debuggable="true">
    <activity android:name="AheadStart" android:label="@string/app_name"
            android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment