コード例 #1
0
  public void callback(Coordenada coordenada) {
    this.coordenada = coordenada;

    hide();
    progressBarAdministrator.showWithText(R.string.buscando_pontos_proximos);
    pontosEOnibusTask = new PontosEOnibusTask(cache, this).execute(coordenada);
  }
コード例 #2
0
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    if (item.getItemId() == R.id.menu_atualizar) {
      hide();
      progressBarAdministrator.showWithText(R.string.carregando_gps);
      if (locationIntent != null) {
        stopService(locationIntent);
        startService(locationIntent);
      }
      return true;

      //			Intent i = new Intent(Intent.ACTION_VIEW);
      //			i.setData(Uri.parse("busao://localhost/acao/customizada/mostrar"));
      //			startActivity(i);
    }
    return super.onOptionsItemSelected(item);
  }
コード例 #3
0
  @Override
  public void dealWithResult(final List<Ponto> pontos) {
    pontosExpandableListView.setAdapter(new PontosEOnibusAdapter(pontos, this));

    pontosExpandableListView.setOnChildClickListener(
        new OnChildClickListener() {

          @Override
          public boolean onChildClick(
              ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
            Onibus onibus = pontos.get(groupPosition).getOnibuses().get(childPosition);

            Intent intent = new Intent(PontosProximosActivity.this, MapaDoOnibusActivity.class);

            intent.putExtra(Extras.ONIBUS, onibus);

            startActivity(intent);

            return false;
          }
        });
    pontosExpandableListView.setVisibility(View.VISIBLE);
    progressBarAdministrator.hide();
  }