Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

ActivityIndicator not working

$
0
0

this page is redirected from another page and will be redirected to another page. it's a intermediate page.. i want an activity indicator here as i have done some background work here. here is code :

var win = Ti.UI.currentWindow;
 
win.backgroundColor = 'white';
 
var sessionID = win.obj;
 
 
var style = {};
if (Ti.Platform.name === 'iPhone OS'){
  style = Ti.UI.iPhone.ActivityIndicatorStyle.DARK;
}
else {
  style = Ti.UI.ActivityIndicatorStyle.DARK;
}
var activityIndicator = Ti.UI.createActivityIndicator({
  color: 'green',
  font: {fontFamily:'Helvetica Neue', fontSize:26, fontWeight:'bold'},
  message: 'Loading...',
  style:style,
  //top:10,
  left:10,
  verticalAlign:'center',
  height:Ti.UI.SIZE,
  width:Ti.UI.SIZE
});
 
// The activity indicator must be added to a window or view for it to appear
win.add(activityIndicator);
 
// eventListeners must always be loaded before the event is likely to fire
// hence, the open() method must be positioned before the window is opened
win.addEventListener('open', function (e) {
  activityIndicator.show();
  // do some work that takes 6 seconds
  // ie. replace the following setTimeout block with your code
 
 
    var soapRequest = 'some xml'; //write your xml request including the parameters
 
var client = Ti.Network.createHTTPClient();
 
client.open('POST', 'url');
 
client.setRequestHeader("SOAPAction", "method"); //method (or function, like you said) of the web service. Check your wsdl to see if is the right one!
 
client.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
 
client.send(soapRequest); //send the xml
 
client.onerror = function(e) {
    Ti.API.info(e);
};
 
client.onload = function(e){
    var doc = this.responseXML.documentElement.getElementsByTagName('tag');
 
    var soapRequest2 = 'some xml' //write your xml request including the parameters
 
    var client2 = Ti.Network.createHTTPClient();
 
    client2.open('POST', 'url');
 
    client2.setRequestHeader("SOAPAction", "method"); //method (or function, like you said) of the web service. Check your wsdl to see if is the right one!
 
    client2.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
 
    client2.send(soapRequest2); //send the xml
 
    client2.onerror = function(e) {
        Ti.API.info(e);
    };
 
    client2.onload = function(e){
        var store = this.responseXML.documentElement.getElementsByTagName('tag');
        var winTemp2 = Titanium.UI.createWindow({
                title:'PFA info service',
                color: "#fff",
                tabBarHidden:true,
                url:'firstPage.js',
                barColor: '#e9671c' ,
                obj1 : doc,
                obj2 : store
                //leftNavButton:backButton
            });
 
            winTemp2.open();
    };
};
 activityIndicator.hide();
});
win.open();

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>