Alert Dialog not displayed in front of all windows
Hi,
I'm using Titanium Mobile SDK 1.3.0 and want to display an alert dialog in my Android app. I tried alert('test')
and Titanium.UI.createAlertDialog
. The problem is that the alert dialog appears not till I go back to the first window using the "back" Button.
I'm creating my windows like this:
var params = { title: 'test',
modal: true };
var win = Titanium.UI.createWindow(params);
win.open();
...
win.add(...);
...
win.show();
I tried also with different params modal = false, and different zIndex but without success. I do not pass a url parameter.
This behavior also belongs to runtime errors. I see the runtime error dialog not till I go back to the first window.
Can anyone help me?
Thx + Greetz
4 Answers
-
This is how I do for now (alert function will not work):
//do not set "a" in a function ! //"a" must be global on the current window var a = Ti.UI.createAlertDialog(); //then add "a" to "win" win.add(a); function tryAlert(obj){ a.message = obj.message; a.title = obj.title; a.show(); } //test it: tryAlert({ title: 'Test', message: 'My message to show' });
But yes, this is a bug :)
-
The alert dialog appears in front of all windows when I use the "url" parameter to create a new window, otherwise not. But I will not wan't to use the url parameter. Is there another solution?
-
I have this issue in Titanium Mobile SDK 1.3.2 again now, even when I use the url parameter to open a new window. Has someone similar issues?
-
This is how I do for now (alert function will not work):
//do not set "a" in a function ! //"a" must be global on the current window var a = Ti.UI.createAlertDialog(); //then add "a" to "win" win.add(a); function tryAlert(obj){ a.message = obj.message; a.title = obj.title; a.show(); } //test it: tryAlert({ title: 'Test', message: 'My message to show' });
But yes, this is a bug :)