Example usage for android.app ProgressDialog show

List of usage examples for android.app ProgressDialog show

Introduction

In this page you can find the example usage for android.app ProgressDialog show.

Prototype

public static ProgressDialog show(Context context, CharSequence title, CharSequence message,
        boolean indeterminate) 

Source Link

Document

Creates and shows a ProgressDialog.

Usage

From source file:org.schtief.partybolle.uffjaben.UffjabenManager.java

public void checkUffjabe(String name, long challengeId, String qr, Location location) {
    dialog = ProgressDialog.show(app, "", "Ick checke mal die Uffjabe, dit dauert", true);
    new CheckUffjabenThread(dialog, name, challengeId, qr, location).start();
}

From source file:app.nichepro.fragmenttab.account.AbstractGetNameTask.java

@Override
protected void onPreExecute() {
    super.onPreExecute();
    dialog = ProgressDialog.show(mActivity, "", "Loading. Please wait...", true);

}

From source file:edu.usf.cutr.opentripplanner.android.serialization.TripRequest.java

protected void onPreExecute() {
    progressDialog = ProgressDialog.show(context, "", "Generating trip. Please wait... ", true);
}

From source file:com.wpi.assistments.HomeTabbedActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.activity_webview);

    final ProgressDialog pd = ProgressDialog.show(this, "", "Loading...", true);

    isTeacher = false;//from   w w w .  j a v  a2 s .c om
    toggle = true;
    logoutFlag = false;

    homeWebView = (WebView) findViewById(R.id.homeWebView);
    homeWebView.setWebViewClient(new WebViewClient() {
        public void onPageFinished(WebView view, String url) {
            Log.i("test", view.getUrl());
            if (view.getUrl().equals("https://www.assistments.org/account/login") && !logoutFlag) {

                Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
                intent.putExtra("showPopup", "true");
                startActivity(intent);
                finish();
            } else if (view.getUrl().equals("https://www.assistments.org/teacher")) {
                isTeacher = true;
            } else if (view.getUrl().equals("https://www.assistments.org/account/login") && logoutFlag) {
                Intent intent = new Intent(getApplicationContext(), LoginActivity.class);
                startActivity(intent);
            }

            if (!homeWebView.canGoBack()) {
                btnBack.setEnabled(false);
            } else {
                btnBack.setEnabled(true);
            }

            if (!homeWebView.canGoForward()) {
                btnForward.setEnabled(false);
            } else {
                btnForward.setEnabled(true);
            }

            if (pd.isShowing() && pd != null) {
                pd.dismiss();
            }
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
            pd.show();
            view.loadUrl(url);
            return true;
        }
    });
    homeWebView.setWebChromeClient(new WebChromeClient() {
        @Override
        public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) {
            new AlertDialog.Builder(webviewContext).setTitle("ASSISTments").setMessage(message)
                    .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            logoutFlag = true;
                            result.confirm();
                        }
                    }).setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
                        public void onClick(DialogInterface dialog, int which) {
                            result.cancel();
                        }
                    }).create().show();

            return true;
        }
    });

    if (savedInstanceState != null) {
        homeWebView.restoreState(savedInstanceState);
    } else {
        /** Scaling, replaced by overview mode and wide view port
        Display display = getWindowManager().getDefaultDisplay();
        Point size = new Point();
        display.getSize(size);
        if (size.x <= 780) {
           int scaleRate = (int) ((size.x) / 7.8);
           Log.i("test", Integer.toString(size.x));
           homeWebView.setInitialScale(scaleRate);
        }
        */

        Intent intent = getIntent();

        if (intent.getStringExtra("username").equals("") && intent.getStringExtra("password").equals("")) {
            homeWebView.loadUrl("https://www.assistments.org/signup");

        } else {
            String username = intent.getStringExtra("username");
            String password = intent.getStringExtra("password");

            String postData = "login=" + username + "&password=" + password + "&commit=Log in";
            homeWebView.postUrl("https://www.assistments.org/account/login",
                    EncodingUtils.getBytes(postData, "BASE64"));
        }

    }

    WebSettings settings = homeWebView.getSettings();
    settings.setSaveFormData(false);
    settings.setSavePassword(false);
    settings.setJavaScriptEnabled(true);
    settings.setBuiltInZoomControls(true);
    settings.setDisplayZoomControls(false);
    settings.setJavaScriptCanOpenWindowsAutomatically(true);
    settings.setSupportMultipleWindows(true);
    settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
    settings.setAppCacheEnabled(false);
    settings.setDomStorageEnabled(true);
    settings.setDatabaseEnabled(true);
    settings.setUseWideViewPort(false);
    settings.setLoadWithOverviewMode(true);
    homeWebView.clearCache(true);
    homeWebView.setPadding(0, 0, 0, 0);
    homeWebView.setInitialScale(getScale());

    btnBack = (Button) findViewById(R.id.btnBack);
    btnBack.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            homeWebView.goBack();
        }
    });

    btnRefresh = (Button) findViewById(R.id.btnRefresh);
    btnRefresh.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {

            //homeWebView.zoomOut();
            homeWebView.scrollTo(1000, 0);
            Log.i("test", "111");
            //homeWebView.reload();
        }
    });

    btnForward = (Button) findViewById(R.id.btnForward);
    btnForward.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            homeWebView.goForward();
        }
    });

    btnOffline = (Button) findViewById(R.id.btnOffline);
    btnOffline.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (toggle) {
                homeWebView.loadUrl(
                        "https://www.assistments.org/assistments/student/index.html#offlineUserAssignmentList/");
                btnOffline.setText("Home");
                toggle = false;
            } else {
                if (isTeacher) {
                    homeWebView.loadUrl("https://www.assistments.org/teacher");
                } else {
                    homeWebView.loadUrl("https://www.assistments.org/tutor");
                }
                btnOffline.setText("Offline");
                toggle = true;
            }

        }
    });
}

From source file:com.dedipower.portal.android.InvoiceLanding.java

public void onCreate(Bundle savedInstanceState) {
    API.SessionID = getIntent().getStringExtra("sessionid");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.invoicelanding);
    final ListView list = (ListView) findViewById(R.id.InvoiceList);

    final ProgressDialog dialog = ProgressDialog.show(this, "DediPortal", "Please wait: loading data....",
            true);//from w w w  . j a v a2s.c  o  m
    final Handler handler = new Handler() {
        public void handleMessage(Message msg) {
            dialog.dismiss();
            if (Success.equals("true")) {
                UpdateErrorMessage(ErrorMessage);
                InvoiceAdaptor adapter = new InvoiceAdaptor(InvoiceLanding.this, listOfInvoices, API.SessionID);
                list.setAdapter(adapter);
            } else {
                UpdateErrorMessage(ErrorMessage);
            }
        }
    };

    Thread dataPreload = new Thread() {
        public void run() {
            try {
                InvoiceAPIReturn = API.PortalQueryHack("invoices", "", "");
                Success = InvoiceAPIReturn.getString("success");
            } catch (JSONException e) {
                ErrorMessage = "An unrecoverable JSON Exception occured.";
                Success = "false";
            }

            if (Success.equals("false")) {
                Log.i("API", "Success was false");
                try {
                    ErrorMessage = InvoiceAPIReturn.getJSONObject("hackReturn").getString("msg");
                } catch (JSONException e) {
                    ErrorMessage = "A JSON parsing error prevented an exact error message to be determined.";
                }
            } else {
                int InvoiceCount = 0;
                Log.i("APIFuncs", InvoiceAPIReturn.toString());
                try {
                    Invoices = InvoiceAPIReturn.getJSONObject("hackReturn").getJSONArray("data");
                    InvoiceCount = Invoices.length();
                    ErrorMessage = "";
                } catch (JSONException e) {
                    ErrorMessage = "There don't appear to be any invoices for your account.....";
                    InvoiceCount = 0;
                    Log.e("API", "There was an eror parsing the array");
                    Log.e("API", e.getMessage());
                }

                //OK lets actually do something useful

                if (InvoiceCount == 0) {
                    Success = "false";
                    ErrorMessage = "There are no invoices for your account.";
                    handler.sendEmptyMessage(0);
                    return;
                }

                for (int i = 0; i < InvoiceCount; i++) {
                    JSONObject CurrentInvoice = null;
                    try {
                        CurrentInvoice = Invoices.getJSONObject(i);
                    } catch (JSONException e1) {
                        Log.e("APIFuncs", e1.getMessage());
                    }
                    try {
                        if (CurrentInvoice.getString("type").equals("invoice"))
                            listOfInvoices.add(new Invoices(CurrentInvoice.getString("ref"),
                                    CurrentInvoice.getDouble("amount"), CurrentInvoice.getString("details"),
                                    CurrentInvoice.getLong("date")));
                    } catch (JSONException e) {
                        Log.e("APIFuncs", e.getMessage());
                    }
                }
            }

            handler.sendEmptyMessage(0);
        }
    };

    dataPreload.start();
}

From source file:com.dedipower.portal.android.TicketLanding.java

public void onCreate(Bundle savedInstanceState) {
    API.SessionID = getIntent().getStringExtra("sessionid");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.ticketlanding);
    final ListView list = (ListView) findViewById(R.id.TicketList);

    final ProgressDialog dialog = ProgressDialog.show(this, "DediPortal", "Please wait: loading data....",
            true);/*from   w  ww .j  av  a2s . co  m*/
    final Handler handler = new Handler() {
        public void handleMessage(Message msg) {
            dialog.dismiss();
            if (Success.equals("true")) {
                UpdateErrorMessage(ErrorMessage);
                OpenTicketsAdaptor adapter = new OpenTicketsAdaptor(TicketLanding.this, listOfTickets,
                        API.SessionID);
                list.setAdapter(adapter);
            } else {
                UpdateErrorMessage(ErrorMessage);
            }
        }
    };

    Thread dataPreload = new Thread() {
        public void run() {
            try {
                TicketAPI = API.PortalQuery("tickets", "none");
                Success = TicketAPI.getString("success");
            } catch (JSONException e) {
                ErrorMessage = "An unrecoverable JSON Exception occured.";
                Success = "false";
            }

            if (Success.equals("false")) {
                try {
                    ErrorMessage = TicketAPI.getString("msg");
                } catch (JSONException e) {
                    ErrorMessage = "A JSON parsing error prevented an exact error message to be determined.";
                }
            } else {
                Log.i("APIFuncs", TicketAPI.toString());
                try {
                    Tickets = TicketAPI.getJSONArray("tickets");
                    ErrorMessage = "";
                } catch (JSONException e) {
                    ErrorMessage = "There are no open tickets for your account.";
                }

                //OK lets actually do something useful
                //ListView list = (ListView)findViewById(R.id.TicketList);
                //List<OpenTickets> listOfTickets = new ArrayList<OpenTickets>();
                int TicketCount = Tickets.length();

                if (TicketCount == 0) {
                    ErrorMessage = "There are no open tickets for your account.";
                    handler.sendEmptyMessage(0);
                    return;
                }

                for (int i = 0; i < TicketCount; i++) {
                    JSONObject CurrentTicket = null;
                    try {
                        CurrentTicket = Tickets.getJSONObject(i);
                    } catch (JSONException e1) {
                        Log.e("APIFuncs", e1.getMessage());
                    }
                    try {
                        listOfTickets.add(new OpenTickets(CurrentTicket.getString("status"),
                                CurrentTicket.getInt("id"), CurrentTicket.getString("server"),
                                CurrentTicket.getString("email"), CurrentTicket.getString("subject"),
                                CurrentTicket.getInt("createdat"), CurrentTicket.getInt("lastupdate"), false));
                        //CurrentTicket.getBoolean("subscriber")));
                    } catch (JSONException e) {
                        Log.e("APIFuncs", e.getMessage());
                    }
                }
            }

            handler.sendEmptyMessage(0);
        }
    };

    dataPreload.start();
}

From source file:br.ufc.mdcc.benchimage2.util.ExportData.java

@Override
protected void onPreExecute() {
    progressDialog = ProgressDialog.show(context, "", "Exportando banco para arquivo CSV...", true);
    progressDialog.show();/*from  ww  w.  j a  va  2s  .  co  m*/
}

From source file:com.dedipower.portal.android.ColoLanding.java

public void onCreate(Bundle savedInstanceState) {
    API.SessionID = getIntent().getStringExtra("sessionid");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.cololanding_iclone);
    //Temp//from w w w .  ja va 2 s . c o m
    list = (ListView) findViewById(R.id.ColoCabList);
    final ProgressDialog dialog = ProgressDialog.show(this, "DediPortal", "Please wait: loading data....",
            true);
    final Handler handler = new Handler() {
        public void handleMessage(Message msg) {
            dialog.dismiss();
            if (Success.equals("true")) {
                UpdateErrorMessage(ErrorMessage);
                ColoRacksAdaptor adapter = new ColoRacksAdaptor(ColoLanding.this, listOfColoRacks);
                list.setAdapter(adapter);
            } else {
                UpdateErrorMessage(ErrorMessage);
            }
        }
    };

    Thread dataPreload = new Thread() {
        public void run() {
            try {
                Colo = API.PortalQuery("colocation", "none");
                Success = Colo.getString("success");
            } catch (JSONException e) {
                ErrorMessage = "An unrecoverable JSON Exception occurred.";
                //UpdateErrorMessage("An unrecoverable JSON Exception occurred.");
            }

            if (Success.equals("false")) {
                try {
                    //UpdateErrorMessage(Colo.getString("msg"));
                    ErrorMessage = Colo.getString("msg");
                } catch (JSONException e) {
                    ErrorMessage = "An unrecoverable JSON Exception occured.";
                    //UpdateErrorMessage("An unrecoverable JSON Exception occured.");
                }
            } else {
                Log.i("APIFuncs", Colo.toString());
                try {
                    ColoCabs = Colo.getJSONArray("colocation");
                    ErrorMessage = "";
                    //UpdateErrorMessage("");
                } catch (JSONException e) {
                    ErrorMessage = "There are no Co-Location Cabinets in your account.";
                    //UpdateErrorMessage("There are no Co-Location Cabinets in your account.");
                }

                int ColoCount = ColoCabs.length();

                if (ColoCount == 0) {
                    //UpdateErrorMessage("There are no colocation cabinets for your account.");
                    ErrorMessage = "There are no colocation cabinets for your account.";
                    handler.sendEmptyMessage(0);
                    return;
                }

                for (int i = 0; i < ColoCount; i++) {
                    JSONObject CurrentColo = null;
                    try {
                        CurrentColo = ColoCabs.getJSONObject(i);
                    } catch (JSONException e1) {
                        Log.e("APIFuncs", e1.getMessage());
                    }

                    try {
                        listOfColoRacks.add(new ColoRacks(CurrentColo.getString("ip"),
                                CurrentColo.getString("servercode"), CurrentColo.getString("facility"),
                                CurrentColo.getInt("bandwidth"), CurrentColo.getString("bandwidthTotal"),
                                CurrentColo.getInt("transferlimit"), CurrentColo.getString("state")));
                    } catch (JSONException e) {
                        Log.e("APIFuncs", e.getMessage());
                    }
                }
            }
            handler.sendEmptyMessage(0);
        }
    };

    dataPreload.start();
    //temp

    /*try 
    {
       Colo = API.PortalQuery("colocation", "none");
      Success = Colo.getString("success");   
    } 
    catch (JSONException e) 
    {
       UpdateErrorMessage("An unrecoverable JSON Exception occured.");
       //Toast.makeText(ColoLanding.this, "An unrecoverable JSON Exception occured.", Toast.LENGTH_LONG).show();
    }
            
    if(Success == "false")
    {
       try 
       {
    UpdateErrorMessage(Colo.getString("msg"));
      } 
       catch (JSONException e) 
       {
     UpdateErrorMessage("An unrecoverable JSON Exception occured.");
      }
    }
    else
    {
       Log.i("APIFuncs",Colo.toString());
       try
        {
      ColoCabs = Colo.getJSONArray("colocation");
      UpdateErrorMessage("");
        }
        catch (JSONException e) 
        {
      UpdateErrorMessage("There are no Co-Location Cabinets in your account.");
        }
                
        //OK lets actually do something useful
        ListView list = (ListView)findViewById(R.id.ColoCabList);
        List<ColoRacks> listOfColoRacks = new ArrayList<ColoRacks>();
        int ColoCount = ColoCabs.length();
                
        if(ColoCount == 0)
        {
      UpdateErrorMessage("There are no colocation cabinets for your account.");
      return;
        }
                
        for(int i = 0; i < ColoCount; i++)
        {
      JSONObject CurrentColo = null;
    try 
    {
       CurrentColo = ColoCabs.getJSONObject(i);
    } 
    catch (JSONException e1) 
    {
       Log.e("APIFuncs",e1.getMessage());
    }
      try 
      {
       listOfColoRacks.add(new ColoRacks(CurrentColo.getString("ip"),
                                 CurrentColo.getString("servercode"),
                                 CurrentColo.getString("facility"), 
                                 CurrentColo.getInt("bandwidth"), 
                                 CurrentColo.getString("bandwidthTotal"), 
                                 CurrentColo.getInt("transferlimit"), 
                                 CurrentColo.getString("state")));
    } 
      catch (JSONException e) 
      {
         Log.e("APIFuncs",e.getMessage());
    }
        }
                
        ColoRacksAdaptor adapter = new ColoRacksAdaptor(this, listOfColoRacks);
                
        list.setAdapter(adapter);
            
    }*/
}

From source file:com.dedipower.portal.android.CDNLanding.java

public void onCreate(Bundle savedInstanceState) {
    API.SessionID = getIntent().getStringExtra("sessionid");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.cdnlanding);

    //Progress test
    list = (ListView) findViewById(R.id.CDNList);
    final ProgressDialog dialog = ProgressDialog.show(this, "DediPortal", "Please wait: loading data....",
            true);//from   w  w  w.  j a va2 s .  c o  m
    final Handler handler = new Handler() {
        public void handleMessage(Message msg) {
            dialog.dismiss();
            if (Success.equals("true")) {
                UpdateErrorMessage(ErrorMessage);
                CDNAdaptor adapter = new CDNAdaptor(CDNLanding.this, listOfCDNs);
                list.setAdapter(adapter);
            } else {
                UpdateErrorMessage(ErrorMessage);
            }
        }
    };

    Thread dataPreload = new Thread() {
        public void run() {
            try {
                CDNs = API.PortalQuery("cdn", "none");
                Success = CDNs.getString("success");
            } catch (JSONException e) {
                ErrorMessage = "An unrecoverable JSON Exception occured.";
                //UpdateErrorMessage("An unrecoverable JSON Exception occured.");
            }

            if (Success.equals("false")) {
                try {
                    //UpdateErrorMessage(CDNs.getString("msg"));
                    ErrorMessage = CDNs.getString("msg");
                } catch (JSONException e) {
                    //UpdateErrorMessage("A JSON parsing error prevented an exact error message to be determined.");
                    ErrorMessage = "A JSON parsing error prevented an exact error message to be determined.";
                }
            } else {
                try {
                    CDNNodes = CDNs.getJSONArray("cdns");
                    //UpdateErrorMessage("");
                    ErrorMessage = "";
                } catch (JSONException e) {
                    //UpdateErrorMessage("There are no CDN nodes in your account.");
                    ErrorMessage = "There are no CDN nodes in your account.";
                }
                int CDNCount = CDNNodes.length();

                if (CDNCount == 0) {
                    //UpdateErrorMessage("There are no CDN nodes for your account.");
                    ErrorMessage = "There are no CDN nodes for your account.";
                    Success = "false";
                    handler.sendEmptyMessage(0);
                }

                for (int i = 0; i < CDNCount; i++) {
                    try {
                        CurrentCDN = CDNNodes.getJSONObject(i);
                    } catch (JSONException e1) {
                        Log.e("APIFuncs", e1.getMessage());
                    }

                    listOfCDNs.add(new CDN(GetString("name"), GetString("backend"), GetInt("bandwidthemea"),
                            GetInt("bandwidthapac"), GetInt("bandwidthamericas"), GetBool("loadbalanced")));
                }
            }
            handler.sendEmptyMessage(0);
        }
    };

    dataPreload.start();
    //Progress test

    /*try 
    {
       CDNs = API.PortalQuery("cdn", "none");
      Success = CDNs.getString("success");   
    } 
    catch (JSONException e) 
    {
       UpdateErrorMessage("An unrecoverable JSON Exception occured.");
       //Toast.makeText(ColoLanding.this, "An unrecoverable JSON Exception occured.", Toast.LENGTH_LONG).show();
    }
            
    if(Success == "false")
    {
       try 
       {
    UpdateErrorMessage(CDNs.getString("msg"));
      } 
       catch (JSONException e) 
       {
     UpdateErrorMessage("A JSON parsing error prevented an exact error message to be determined.");
      }
    }
    else
    {
       Log.i("APIFuncs",CDNs.toString());
       try
        {
     CDNNodes = CDNs.getJSONArray("cdns");
      UpdateErrorMessage("");
        }
        catch (JSONException e) 
        {
      UpdateErrorMessage("There are no CDN nodes in your account.");
        }
                
        //OK lets actually do something useful
        ListView list = (ListView)findViewById(R.id.CDNList);
        List<CDN> listOfCDNs = new ArrayList<CDN>();
        int CDNCount = CDNNodes.length();
                
        if(CDNCount == 0)
        {
      UpdateErrorMessage("There are no CDN nodes for your account.");
      return;
        }
                
        for(int i = 0; i < CDNCount; i++)
        {
    try 
    {
       CurrentCDN = CDNNodes.getJSONObject(i);
    } 
    catch (JSONException e1) 
    {
       Log.e("APIFuncs",e1.getMessage());
    }
            
         listOfCDNs.add(new CDN(GetString("name"),
               GetString("backend"),
               GetInt("bandwidthemea"),
               GetInt("bandwidthapac"),
               GetInt("bandwidthamericas"),
               GetBool("loadbalanced")));
        }
            
        CDNAdaptor adapter = new CDNAdaptor(this, listOfCDNs);
                
        list.setAdapter(adapter);
    }*/
}

From source file:net.networksaremadeofstring.pulsant.portal.TicketLanding.java

public void onCreate(Bundle savedInstanceState) {
    API.SessionID = getIntent().getStringExtra("sessionid");
    super.onCreate(savedInstanceState);
    setContentView(R.layout.ticketlanding);

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setTitle("Tickets");

    final ListView list = (ListView) findViewById(R.id.TicketList);

    final ProgressDialog dialog = ProgressDialog.show(this, "Pulsant Portal",
            "Please wait: loading tickets....", true);
    final Handler handler = new Handler() {
        public void handleMessage(Message msg) {
            dialog.dismiss();/*from  w w w .  j  ava2  s.  co  m*/
            if (Success.equals("true")) {
                UpdateErrorMessage(ErrorMessage);
                OpenTicketsAdaptor adapter = new OpenTicketsAdaptor(TicketLanding.this, listOfTickets,
                        API.SessionID);
                list.setAdapter(adapter);
            } else {
                UpdateErrorMessage(ErrorMessage);
            }
        }
    };

    Thread dataPreload = new Thread() {
        public void run() {
            try {
                TicketAPI = API.PortalQuery("tickets", "none");
                Success = TicketAPI.getString("success");
            } catch (JSONException e) {
                ErrorMessage = "An unrecoverable JSON Exception occured.";
                Success = "false";
            }

            if (Success.equals("false")) {
                try {
                    ErrorMessage = TicketAPI.getString("msg");
                } catch (JSONException e) {
                    ErrorMessage = "A JSON parsing error prevented an exact error message to be determined.";
                }
            } else {
                Log.i("APIFuncs", TicketAPI.toString());
                try {
                    Tickets = TicketAPI.getJSONArray("tickets");
                    ErrorMessage = "";
                } catch (JSONException e) {
                    ErrorMessage = "There are no open tickets for your account.";
                }

                //OK lets actually do something useful
                //ListView list = (ListView)findViewById(R.id.TicketList);
                //List<OpenTickets> listOfTickets = new ArrayList<OpenTickets>();
                int TicketCount = Tickets.length();

                if (TicketCount == 0) {
                    ErrorMessage = "There are no open tickets for your account.";
                    handler.sendEmptyMessage(0);
                    return;
                }

                for (int i = 0; i < TicketCount; i++) {
                    JSONObject CurrentTicket = null;
                    try {
                        CurrentTicket = Tickets.getJSONObject(i);
                    } catch (JSONException e1) {
                        Log.e("APIFuncs", e1.getMessage());
                    }
                    try {
                        listOfTickets.add(new OpenTickets(CurrentTicket.getString("status"),
                                CurrentTicket.getInt("id"), CurrentTicket.getString("server"),
                                CurrentTicket.getString("email"), CurrentTicket.getString("subject"),
                                CurrentTicket.getInt("createdat"), CurrentTicket.getInt("lastupdate"), false));
                        //CurrentTicket.getBoolean("subscriber")));
                    } catch (JSONException e) {
                        Log.e("APIFuncs", e.getMessage());
                    }
                }
            }

            handler.sendEmptyMessage(0);
        }
    };

    dataPreload.start();
}