Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
public class Main extends Activity{ static final int PROGRESS_DIALOG = 0; Button button; ProgressDialog progressDialog; ProgressDialog myProgressDialog = null; MyDbAdapter adapter; final String employeeURL = http://MY_EMPLOYEE_XML_URL; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); adapter = openDb(); adapter.createAchieTable(); boolean dbInitialized = adapter.initDatabase(); // checks if the database has been successfully initialized if(dbInitialized){ //database has been initialized int i = adapter.getFlag(ACHIE_STATE); if(i == 1){ //ACHIE_STATE == 1; means that the database is already available. button = (Button)findViewById(R.id.show_employees); button.setOnClickListener(new OnClickListener(){ public void onClick(View v){ // Display an indeterminate Progress-Dialog myProgressDialog = ProgressDialog.show(Main.this, "Please wait", "Loading Data...", true); Intent intent = new Intent(Main.this, EmployeeList.class); adapter.close(); myProgressDialog.dismiss(); startActivity(intent); } }); }else{ // ACHIE_STATE < 1; means database hasn't been downloaded yet. Create tables and download data. Log.v(this.getClass().getName(), " download employees"); adapter.createEmployeesTable(); button = (Button)findViewById(R.id.show_employees); button.setOnClickListener(new OnClickListener(){ public void onClick(View v){ // Display an indeterminate Progress-Dialog myProgressDialog = ProgressDialog.show(Main.this, "Message", "Downloading Employee Data", true); if(adapter.getFlag(ACHIE_STATE) < 1){ new Thread() { public void run() { try{ Log.v("Main: ", "Start database check"); Thread.sleep(2000); downloadTables(employeeURL); Log.v("Main: ", "downloaded Employees"); Thread.sleep(2000); } catch (Exception e) { } // Dismiss the Dialog Intent i = new Intent(Main.this, EmployeeList.class); myProgressDialog.dismiss(); startActivity(i); } }.start(); }else if (adapter.getFlag(EMPLOYEES_STATE) >= 1){ Intent i = new Intent(Main.this, EmployeeList.class); myProgressDialog.dismiss(); startActivity(i); } } }); } }else{ // database has not been initialized. Try to initialize it. App should not reach here in normal circumstances. Log.v(this.getClass().getName(), " Initialize database"); } } private MyDbAdapter openDb(){ adapter = new MyDbAdapter(this); adapter.open(); return adapter; } public int downloadTables(String xmlUrl){ int downloadStatus = 0; try{ URL url = new URL(xmlUrl); SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser parser = factory.newSAXParser(); XMLReader reader = parser.getXMLReader(); MyHandler handler = new MyHandler(adapter); reader.setContentHandler(handler); reader.parse(new InputSource(url.openStream())); }catch(Exception e){ Log.e("Error: ", "" + e.getMessage()); System.exit(0); }finally{ downloadStatus = 1; } return downloadStatus; } protected void onPause(){ Log.v("progress bar view: ", "onPause method called"); super.onPause(); } protected void onRestart(){ adapter.close(); adapter = openDb(); super.onRestart(); } protected void onStop(){ adapter.close(); Log.v("progress bar view: ", "onStop method called"); super.onStop(); } protected void onDestroy(){ adapter.close(); Log.v("progress bar view: ", "onDestroy method called"); super.onDestroy(); } }