Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.yourgroup.yourname;
- //import android.app.Activity;
- import android.os.Bundle;
- import org.apache.cordova.*;
- import android.view.WindowManager; // For Full screen
- import android.view.Menu; // For the menu
- import android.view.MenuItem; // For the menu
- public class HelloCordovaActivity extends DroidGap {
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- // The lines to make the app go Full Screen
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN |
- WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
- // The line to add the splashscreen
- super.setIntegerProperty("splashscreen", R.drawable.splash);
- super.loadUrl("file:///android_asset/www/index.html", 3000); // I used 3000 for mine.
- // (..index.html", 3000 ) specifies the miliseconds that the splashscreen will stay up
- // before the app starts.
- }
- // Declaring the Menu options
- @Override
- public boolean onCreateOptionsMenu(Menu menu)
- {
- super.onCreateOptionsMenu(menu);
- int base = Menu.FIRST;
- // Group, item id, order, title
- menu.add(base,base,base,"Quit");
- menu.add(base,base,base,"Reload");
- return true;
- }
- //handle menu item selection
- public boolean onOptionsItemSelected(MenuItem item)
- {
- if (item.hasSubMenu() == false)
- {
- if("Quit"==item.getTitle()) {
- finish();
- }
- if("Reload"==item.getTitle()) {
- super.loadUrl("file:///android_asset/www/index.html");
- }
- }
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement