2

i want to make a splash screen on my android application, i use phonegap.

here is my main.java code :

public class App extends DroidGap {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    super.setIntegerProperty("splashscreen", R.drawable.splash);
    super.loadUrl("file:///android_asset/www/index.html",5000);
}

}

but i got an error : "splash cannot be resolved or is not a field"

i've put the splash.png on every drawable directories, but the error still there..

anybody could help me? thanks in advance..

King Goeks
  • 492
  • 4
  • 11
  • 28

3 Answers3

4

I think there is an issue about the timeout parameter in your case 5000 and it was fixed in phonegap 1.6.0 release that's why you don't get it work:

these links confirms that

How to use OpenStreetMap/OpenLayers?

phonegap - splash screen for Android app

try to use the last phone gap release (1.8.1) and you will get it work

Community
  • 1
  • 1
K_Anas
  • 31,226
  • 9
  • 68
  • 81
  • if you don't get it work let me know and if phonegap 1.8.1 works for you don't forget to mark the answer as accepted – K_Anas Jun 21 '12 at 04:51
  • I am having the same issue in Phonegap 2.5. My error said *"R cannot be resolved to a variable"* - I made sure my image exists in the "drawable" directory: `res/drawable/splash.png` – Ryan Wheale Apr 16 '13 at 18:36
2

just change the word splash by screen:

super.setIntegerProperty("splashscreen", R.drawable.screen);
Brian Mains
  • 50,520
  • 35
  • 148
  • 257
mcfplay
  • 21
  • 1
0

I was having a similar problem. I renamed the package which extended the core DroidGap class. My solution was fixed by this solution: http://www.youtube.com/watch?v=3CHRujojc2o. In short, make sure to update your references in the AndroidManifest.xml file to point to the new package name.

Ryan Wheale
  • 26,022
  • 8
  • 76
  • 96