i have developed an Android app in which i am using both phonegap and Android Native.Where ever it loads phonegap www folder it loads by showing black screen first for 2 sec and then white screen for 6-7 secs is there any way to get rid of this black and white screen?if it is how?i have googled it and used things in below links,but no use(these are solutn while loading app on startup)
How To fix white screen on app Start up?
Why there is a white screen appears for 1sec when starting to run the apps in Android?
How to remove white screen while loading android application?
i am using below code to load www folder data
public class webActivity extends DroidGap {
public static String urlpath;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo wifiNetwork = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
NetworkInfo mobileNetwork = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
if ((wifiNetwork != null && wifiNetwork.isConnected()) || (mobileNetwork != null && mobileNetwork.isConnected())) {
super.setStringProperty("loadingDialog", "Please Wait,Loading...");
super.loadUrl("file:///android_asset/www/reqpage.html?lat="+Activity.latitude+"&long="+Activity.longitude);
}
else{
final AlertDialog alertDialog = new AlertDialog.Builder(
webActivity.this).create();
alertDialog.setTitle("Warning");
alertDialog.setMessage("No network available,<br/>Please check your connectivity.");
alertDialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Intent intent = new Intent(webActivity.this, Activity.class);
startActivity(intent);
}
});
alertDialog.show();
}
}