Exemplo n.º 1
0
  private void getMoreBusinesses() {
    // Set flag so we cant load new items 2 at the same time
    loadingMore = true;

    if (appStatus.isOnline()) {

      Log.i("Checkin", "#########Current Page = " + String.valueOf(iCurrentPageNo));

      double latitude = 0, longitude = 0;

      String lat = appStatus.getSharedStringValue(appStatus.LAT);
      String lon = appStatus.getSharedStringValue(appStatus.LONG);
      if ((lat != null) && (lon != null)) {
        latitude = Double.valueOf(lat);
        longitude = Double.valueOf(lon);
      }

      new BusinessTask(this, bIsSupported, iCurrentPageNo).execute(latitude, longitude);
      iCurrentPageNo++;

    } else {
      // main_context.message("Check internet connectivity!");
      Log.v("CHECKINFORGOOD", "App is not online!");
      Intent intent = new Intent(this, NoConnectivityScreen.class);
      this.startActivity(intent);
      getParent().finish();
    }
    // loadingMore = false;

  }
Exemplo n.º 2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);
    setContentView(R.layout.offers);
    appStatus = AppStatus.getInstance(this);
    appName = appStatus.getSharedStringValue(appStatus.APP_NAME);
    setOffersTabHeader();
    this.onlyShowSupported = true;
    isOnPause = false;
    mhandler = new Handler();
    loading = new ProgressDialog(this);
    loading.setMessage("Loading...");
    loading.setCancelable(true);

    mListView = (ListView) findViewById(android.R.id.list);
    mListView.setOnItemClickListener(itemClick);
    setOnListScrollListener(mListView);
    parentActivity = this.getParent();
    txtViewTopRaisedMoney = (TextView) findViewById(R.id.textViewTopRaisedMoney);

    Log.v("######HEADS UP", "In onCreateView");
  }
Exemplo n.º 3
0
  public void onResume() {

    txtViewTopRaisedMoney.setText(appStatus.setCheckinAmount());
    appStatus = AppStatus.getInstance(this);
    if (ViewOffersActivity.bIsFromSearch) {

      // strProgressMessage = "Loading....";
      strProgressMessage = getString(R.string.searchProgressMessage);
      showDialog(0);
      new SearchTask(this, ViewOffersActivity.offerSearch).execute(ViewOffersActivity.searchQuery);
      Log.v("######HEADS UP", "searching from view offers");
      ViewOffersActivity.bIsFromSearch = false;
    } else {
      /*
       * if (appStatus.getSharedBoolValue(appStatus.IS_APP_RESUMED)) {
       * refreshList();
       * appStatus.saveSharedBoolValue(appStatus.IS_APP_RESUMED, false); }
       * else { updateLocationView(null); }
       */
      if (!isSearchedCalled) refreshList();
    }

    super.onResume();
  }
Exemplo n.º 4
0
 public void updateLocations(Location location) {
   if (appStatus.isOnline()) {
     // String strProgressMessage = "Loading....";
     strProgressMessage = (getString(R.string.businessProgressMessage));
     showDialog(0);
     new BusinessTask(this, onlyShowSupported, 1)
         .execute(location.getLatitude(), location.getLongitude());
     // new BusinessTask(this,
     // onlyShowSupported,1).execute(37.785834,-122.406417);
   } else {
     Intent intent = new Intent(this, NoConnectivityScreen.class);
     this.startActivity(intent);
     // context.message("Check internet connectivity!");
     // Log.v("BusinessFragment", "App is not online!");
     getParent().finish();
   }
 }