/** * Called when "Clear" button is clicked. * * @param v View that was clicked. */ public void onClearClick(View v) { smartStoreIntf.deleteAccountsSoup(); smartStoreIntf.deleteOpportunitiesSoup(); smartStoreIntf.createAccountsSoup(); smartStoreIntf.createOpportunitiesSoup(); Toast.makeText(this, "Offline data has been cleared.", Toast.LENGTH_SHORT).show(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); smartStoreIntf = new SmartStoreInterface(); // Creates soups, if they don't exist already. smartStoreIntf.createAccountsSoup(); smartStoreIntf.createOpportunitiesSoup(); // Configures options for the progress indicator. progressDialog = new ProgressDialog(this); progressDialog.setTitle("Fetching records..."); progressDialog.setMessage("Please wait..."); progressDialog.setCancelable(true); progressDialog.setIndeterminate(true); }