Esempio n. 1
0
    public MyAdapterView(Context context, MyListItem myListItem) {
      super(context);
      this.setOrientation(HORIZONTAL);

      LinearLayout.LayoutParams params =
          new LinearLayout.LayoutParams(200, LayoutParams.WRAP_CONTENT);
      params.setMargins(1, 1, 1, 1);

      TextView name = new TextView(context);
      name.setText(myListItem.getName());
      addView(name, params);

      LinearLayout.LayoutParams params2 =
          new LinearLayout.LayoutParams(200, LayoutParams.WRAP_CONTENT);
      params2.setMargins(1, 1, 1, 1);

      TextView pcode = new TextView(context);
      pcode.setText(myListItem.getPcode());
      addView(pcode, params2);
      pcode.setVisibility(GONE);
    }