Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
tags editadas
Link
ramaral
  • 44,7mil
  • 14
  • 60
  • 110
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Formatar código e remover tag
Fonte Link
ramaral
  • 44,7mil
  • 14
  • 60
  • 110
  • O método loadTrials seta o baseadapter:

    private void loadTrials() { tAdapter = new TrialAdapter(view.getContext(), list_trials); lv_trials.setAdapter(tAdapter); }

      private void loadTrials() {
          tAdapter = new TrialAdapter(view.getContext(), list_trials);
          lv_trials.setAdapter(tAdapter);
      }
    
  • O método check mostra a quantidade de views da lista

    public void check() { Log.v("Bio", "Retorno: " + tAdapter.getQuantViews()); }

      public void check() {
          Log.v("Bio", "Retorno: " + tAdapter.getQuantViews());
      }
    
  • O método loadTrials seta o baseadapter:

    private void loadTrials() { tAdapter = new TrialAdapter(view.getContext(), list_trials); lv_trials.setAdapter(tAdapter); }

  • O método check mostra a quantidade de views da lista

    public void check() { Log.v("Bio", "Retorno: " + tAdapter.getQuantViews()); }

  • O método loadTrials seta o baseadapter:

      private void loadTrials() {
          tAdapter = new TrialAdapter(view.getContext(), list_trials);
          lv_trials.setAdapter(tAdapter);
      }
    
  • O método check mostra a quantidade de views da lista

      public void check() {
          Log.v("Bio", "Retorno: " + tAdapter.getQuantViews());
      }
    
Adicionei o código
Fonte Link

No Base Adapter:

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    Trial t = listTrial.get(position);
    View layout;

    if(convertView == null) {
        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        layout = inflater.inflate(R.layout.item_trial, null);
    } else {
        layout = convertView;
    }

    DecimalFormat df = new DecimalFormat("####.00");

    linkViews(layout);

    tv_trial_name.setText(t.getName());
    tv_trial_date.setText(t.getDate());
    tv_trial_hour.setText(t.getHour());
    tv_peak_force.setText(
            layout.getResources().getString(R.string.text_peak_force) + ":  " + df.format(t.getPeakForce()));
    tv_comments.setText(t.getComment());

    this.listViews.add(layout);
    Log.v("Bio", "listViews size: " + this.listViews.size());

    return layout;
}

public int getQuantViews() {
    return this.listViews.size();
}

No Fragment:

@Override
public void onStart() {
    loadTrials();
    super.onStart();
    Log.v("Bio", "onStart");
}

@Override
public void onResume() {
    super.onResume();
    Log.v("Bio", "onResume");
    check();
}
  • O método loadTrials seta o baseadapter:

    private void loadTrials() { tAdapter = new TrialAdapter(view.getContext(), list_trials); lv_trials.setAdapter(tAdapter); }

  • O método check mostra a quantidade de views da lista

    public void check() { Log.v("Bio", "Retorno: " + tAdapter.getQuantViews()); }

No Base Adapter:

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    Trial t = listTrial.get(position);
    View layout;

    if(convertView == null) {
        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        layout = inflater.inflate(R.layout.item_trial, null);
    } else {
        layout = convertView;
    }

    DecimalFormat df = new DecimalFormat("####.00");

    linkViews(layout);

    tv_trial_name.setText(t.getName());
    tv_trial_date.setText(t.getDate());
    tv_trial_hour.setText(t.getHour());
    tv_peak_force.setText(
            layout.getResources().getString(R.string.text_peak_force) + ":  " + df.format(t.getPeakForce()));
    tv_comments.setText(t.getComment());

    this.listViews.add(layout);
    Log.v("Bio", "listViews size: " + this.listViews.size());

    return layout;
}

public int getQuantViews() {
    return this.listViews.size();
}

No Fragment:

@Override
public void onStart() {
    loadTrials();
    super.onStart();
    Log.v("Bio", "onStart");
}

@Override
public void onResume() {
    super.onResume();
    Log.v("Bio", "onResume");
    check();
}
  • O método loadTrials seta o baseadapter:

    private void loadTrials() { tAdapter = new TrialAdapter(view.getContext(), list_trials); lv_trials.setAdapter(tAdapter); }

  • O método check mostra a quantidade de views da lista

    public void check() { Log.v("Bio", "Retorno: " + tAdapter.getQuantViews()); }

formatação de termos específicos
Fonte Link
Carregando