Languages

Menu
Sites
Language
App displays black screen after being applied. How to fix it?

The reason is "App displays black screen after being applied. Need touch on screen to play ". What can be a reason of this bug?

In file main.js (code for running or exit the app - the next  javascript code - https://jsfiddle.net/xt4tyhb1/). Maybe must be something else?

 

Responses

2 Replies
Nafisul Islam Kiron

Hi, try like this,

HTML part:

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="Tizen Wearable Web Basic Template" />

    <title>Tizen Wearable Web Basic Application</title>

    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <script src="js/main.js"></script>
</head>

<body>
    <div id="main" class="page">
        <div class="contents">
            <span id="content-text">Basic</span>
        </div>
    </div>
</body>

</html>

JS part:

window.onload = function () {
    // TODO:: Do your initialization job

    // add eventListener for tizenhwkey
    document.addEventListener('tizenhwkey', function(e) {
        if(e.keyName === "back")
        {
			try {
			    tizen.application.getCurrentApplication().exit();
			} catch (ignore) {
			}
    	}
    });

    // Sample code
    var textbox = document.querySelector('.contents');
    textbox.addEventListener("click", function(){
    	var box = document.querySelector('#content-text');
    	box.innerHTML = box.innerHTML === "Basic" ? "Sample" : "Simple";
    });
    
};

 

Lena Dragan

Thank you for unswer, but after changes in files - the same problem (app was rejected with this bug).