08-27-2012 02:43 AM
Hi
when i am getting blackscreen after splash screen in android using phone gap technology
i am using this code
package com.test.cordova;
import org.apache.cordova.DroidGap;
import android.os.Bundle;
import android.view.View;
public class HelloCordovaActivity extends DroidGap {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
super.setIntegerProperty("splashscreen", R.drawable.splash);
super.loadUrl("file:///android_asset/www/index.htm l",10000);
super.setIntegerProperty("loadUrlTimeoutValue", 10000);
}
}actully i am calling webservice onload=" function" in body.First splash screen display then blackscreen come after that index.html with respose , i want to remove black screen
08-27-2012 04:26 AM - edited 08-27-2012 04:30 AM
For Cordova/Phonegap issues you might want to try the Freenode IRC #phonegap or the Google forum to ask or search for something about your issue.
BTW: My source code I'm using for Android + Phonegap/Cordova looks like this:
package com.myPackage;
import com.phonegap.DroidGap;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Window;
public class App extends DroidGap {
/** On back button pressed leave app */
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
moveTaskToBack(true);
return true;
}
return super.onKeyDown(keyCode, event);
}
/** Called when the activity is first created */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/** hide action bar at runtime */
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.loadUrl("file:///android_asset/www/index.htm l");
}
}
08-27-2012 04:43 AM
08-27-2012 04:51 AM
You need to differentiate between this Java source code loading your index.html and the WebService request you are doing within your index.html source code. You can not call/request the WebService before the index.html is loaded, and if the index.html is loaded the Android/Java splash screen will be hidden. You need to understand what you are implementing and that Java isn't JavaScript.
Why not showing a splash screen also within your index.html source and hide it after the WebService request is done like you make with the input buttons I wrote in the other post.
08-27-2012 05:02 AM
08-27-2012 05:06 AM
Do not know why it should work on the one and isn't working on the other. Are you using the different JavaScript PhoneGap/Cordova libraries for every device/OS? Are you getting an issue in the Debugger Console (if using Eclipse perhaps)?