Example #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;

  }
Example #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");
  }