Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Black Screen display after splash screen in android using phone gap

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.html",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

Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Black Screen display after splash screen in android using phone gap

[ Edited ]

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.html");
    }
}

 


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Black Screen display after splash screen in android using phone gap

but how to show splash screen until i get web service response .

No screen in between.
i know this is the code show splash screen
super.setIntegerProperty("splashscreen", R.drawable.splash);
but after splash screen it show blackscreen
Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Black Screen display after splash screen in android using phone gap

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.


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Developer
Posts: 777
Registered: ‎07-21-2012
My Device: 9810
My Carrier: 0

Re: Black Screen display after splash screen in android using phone gap

You are write but splash screen is display every time when i call index.html.that was the problem ..But in blackberry loading image is display while i get web service response only first time but not in android it will show blacksreen,
Developer
Developer
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: Black Screen display after splash screen in android using phone gap

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)?


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.