title: Is it possible to pass only String to a custom listview adapter?
body: <p>I am passing through a while loop which has different <code>Strings</code> for my adapter. But it doesn't show anything, however if I pass an array it works. I don't know if I can pass only a <code>String</code> and if the <code>return</code> of the overridden methods are correct.</p>
  
  <pre><code>public class ReportAdapter extends BaseAdapter {
  
  private Context context;
  private String debtor;
  private String receiver;
  private BigDecimal difference;
  private String groupName;
  LayoutInflater inflater;
  
  public ReportAdapter(Context applicationContext, String debtor, String receiver, BigDecimal difference, String groupName) {
      this.context = applicationContext;
      this.debtor = debtor;
      this.receiver = receiver;
      this.difference = difference;
      this.groupName = groupName;
      inflater = LayoutInflater.from(applicationContext);
  
  }
  
  
  @Override
  public int getCount() {
      return 0;
  }
  
  @Override
  public Object getItem(int position) {
      return 0;
  }
  
  @Override
  public long getItemId(int position) {
      return 0;
  }
  
  @Override
  public View getView(final int position, View convertView, ViewGroup parent) {
  
      DecimalFormat df = new DecimalFormat("##.00");
      SharedPreferences sharedPrefs = context.getSharedPreferences("sharedPrefs", Context.MODE_PRIVATE);
      final SharedPreferences.Editor editor = sharedPrefs.edit();
      convertView = inflater.inflate(R.layout.report_list_view, null);
      TextView debtor = convertView.findViewById(R.id.debtor_tv);
      TextView receiver = convertView.findViewById(R.id.receiver);
      TextView difference = convertView.findViewById(R.id.difference_tv);
      final CardView paidCard = convertView.findViewById(R.id.paid_cardview);
      final Switch paidSwitch = convertView.findViewById(R.id.paid_switch);
  
  
      debtor.setText(debtor.toString());
  
      receiver.setText(receiver.toString());
  
      difference.setText(String.valueOf(df.format(difference) + "€"));
  
      paidSwitch.setChecked(sharedPrefs.getBoolean(groupName + "_checkValue" + position, false));
      if (paidSwitch.isChecked()) {
          // Set green background
          paidCard.setCardBackgroundColor(Color.parseColor("#FF2E7D32"));
      }
      paidSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
          @Override
          public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
              if (isChecked) {
                  // Set green background
                  paidCard.setCardBackgroundColor(Color.parseColor("#FF2E7D32"));
                  editor.putBoolean(groupName + "_checkValue" + position, isChecked);
                  editor.commit();
  
              } else {
                  // Set red background
                  paidCard.setCardBackgroundColor(Color.parseColor("#FFB71C1F"));
                  editor.putBoolean(groupName + "_checkValue" + position, isChecked);
                  editor.commit();
  
              }
  
          }
      });
      return convertView;
  }
  </code></pre>
  
  <p>The listview doesn't appear. Could it be that the constructor accepts only Array type? Or I can pass a <code>String</code>? The <code>getCount()</code> and the <code>getItem()</code> methods, have to return 0? Because with an ArrayList I return the <code>arraylist.get(position)</code>, but with a <code>String</code>, what should I return?</p>