private void updateProgress() { for (Action a : Action.values()) { if (a == currentAction) { // this is the current action showInProgress(a.viewId); } else if (a.ordinal() < currentAction.ordinal()) { // this action has completed showResult(a.viewId, results[a.ordinal()]); } else { // this action hasn't started showNotStarted(a.viewId); } } ChipsetDetection detection = ChipsetDetection.getDetection(); if (currentAction == Action.Finished) if (detection == null || detection.getWifiChipset() == null || detection.getWifiChipset().supportedModes == null || detection.getWifiChipset().supportedModes.contains(WifiMode.Adhoc) == false) { app.showNoAdhocDialog = true; LogActivity.logMessage( "detect", "Could not work out how to control your WiFi chipset. Relying on operating system, so no ad-hoc WiFi.", false); } }
@Override public void onClick(View view) { switch (view.getId()) { case R.id.btncall: startActivity(new Intent(Intent.ACTION_DIAL)); break; case R.id.messageLabel: if (!ServalD.isRhizomeEnabled()) { app.displayToastMessage("Messaging cannot function without an sdcard"); return; } startActivity( new Intent( getApplicationContext(), org.servalproject.messages.MessagesListActivity.class)); break; case R.id.mapsLabel: openMaps(); break; case R.id.contactsLabel: startActivity( new Intent(getApplicationContext(), org.servalproject.ui.ContactsActivity.class)); break; case R.id.settingsLabel: startActivity( new Intent( getApplicationContext(), org.servalproject.ui.SettingsScreenActivity.class)); break; case R.id.sharingLabel: startActivity(new Intent(getApplicationContext(), RhizomeMain.class)); break; case R.id.helpLabel: Intent intent = new Intent(getApplicationContext(), HtmlHelp.class); intent.putExtra("page", "helpindex.html"); startActivity(intent); break; case R.id.servalLabel: startActivity(new Intent(getApplicationContext(), ShareUsActivity.class)); break; case R.id.powerLabel: startActivity(new Intent(getApplicationContext(), Networks.class)); break; } }
/** * Run initialisation procedures to setup everything after install. Called from onResume() and * after agreeing Warning dialog */ private void checkAppSetup() { State state = app.getState(); stateChanged(state); if (ServalBatPhoneApplication.terminate_main) { ServalBatPhoneApplication.terminate_main = false; finish(); return; } // Don't continue unless they've seen the warning if (!app.settings.getBoolean(PREF_WARNING_OK, false)) { showDialog(R.layout.warning_dialog); return; } if (state == State.Installing || state == State.Upgrading) { new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... arg0) { app.installFiles(); return null; } }.execute(); if (state == State.Installing) { this.startActivity(new Intent(this, Wizard.class)); finish(); return; } } // Start by showing the preparation wizard // Intent prepintent = new Intent(this, PreparationWizard.class); // prepintent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // startActivity(prepintent); Identity main = Identity.getMainIdentity(); if (main == null || AccountService.getAccount(this) == null || main.getDid() == null) { Log.v("MAIN", "Keyring doesn't seem to be initialised, starting wizard"); this.startActivity(new Intent(this, Wizard.class)); finish(); return; } if (!registered) { IntentFilter filter = new IntentFilter(); filter.addAction(ServalBatPhoneApplication.ACTION_STATE); this.registerReceiver(receiver, filter); registered = true; } TextView pn = (TextView) this.findViewById(R.id.mainphonenumber); String id = ""; if (main.getDid() != null) id = main.getDid(); else id = main.subscriberId.abbreviation(); pn.setText(id); }