1

I am developing a PhoneGap (2.1) for Android using Eclipse. I had a splash screen successfully working, except that it got stretched. To solve the problem I wanted to try out some suggestions I have read on StackOverflow.

However, when I reverted to my original code I got an error message preventing me from building the app.

The code I am using in my main activity is as follows.

super.onCreate(savedInstanceState);
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl("file:///android_asset/www/index.html", 10000);

There is a splash.png image in each of these folders drawable-ldpi drawable-mdpi drawable-hdpi

The error that is reported is "splash cannot be resolved or is not a field".

In my attempts to solve the problem I have already cleaned the project, used "fix project properties", even created a new project from scratch and restarted Eclipse.

Any further suggestions are much appreciated. I am not very familiar with Eclipse, so it may well be that I am missing something obvious.

Thank you for the help.

marco
  • 11
  • 3

1 Answers1

0

After thinking about a completely different approach on search terms for the problem, I managed to find the answer myself here on Stack Overflow.

Short summary: Eclipse auto-added the line

import android.R;

This seems to break the line

super.setIntegerProperty("splashscreen", R.drawable.splash);

As I am not an Android Java developer, this line looked perfectly fine to me and I didn't even note it had been added.

Community
  • 1
  • 1
marco
  • 11
  • 3