小编oya*_*n11的帖子

如何创建一个可以在Java中存储50个字符串的ArrayList?

我想将arraylist限制为50.但我不知道如何.

这是我的代码Object1.java

public class Object1 {

    public String seat_no, id;


    public Object1(String seat_no, String id) {

        this.seat_no = seat_no;
        this.id = id;

    }
}
Run Code Online (Sandbox Code Playgroud)

main.java

private ArrayList<Object1> list;

list = new ArrayList<Object1>();
Run Code Online (Sandbox Code Playgroud)

java arraylist

2
推荐指数
2
解决办法
1757
查看次数

为什么setOnCheckedChangeListener不能在使用LayoutInflater的弹出窗口中工作?

我在弹出窗口中有一个RadioGroup.当我把setoncheckedchangelistener它导致错误.这是我的代码.错误说它不适用于参数(新的复合Button.OnCheckedChangeListener ..我不明白有人可以帮助我吗?

   private void showPopupSeat(final Activity context) 
   {       
       int popupWidth = 500;
       int popupHeight = 650;


   // Inflate the popup_layout.xml
   LinearLayout viewGroup = (LinearLayout) context.findViewById(R.id.popupseat);


   LayoutInflater layoutInflater = (LayoutInflater) context
     .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
   View layout = layoutInflater.inflate(R.layout.seat_dimension, viewGroup);


  RadioGroup rg = (RadioGroup) layout.findViewById(R.id.rg1);
  final RadioButton rb1 = (RadioButton) layout.findViewById(R.id.option1);
  final RadioButton rb2 = (RadioButton) layout.findViewById(R.id.option2);
  final RadioButton rb3 = (RadioButton) layout.findViewById(R.id.option3);

      rg.setOnCheckedChangeListener(new OnCheckedChangeListener() 
      {
          public void onCheckedChanged(RadioGroup group, int checkedId) {

          }
  });


   final PopupWindow popupseat = new PopupWindow(context);
   popupseat.setContentView(layout);
   popupseat.setWidth(popupWidth);
   popupseat.setHeight(popupHeight); …
Run Code Online (Sandbox Code Playgroud)

android popup radio-group

2
推荐指数
1
解决办法
4556
查看次数

标签 统计

android ×1

arraylist ×1

java ×1

popup ×1

radio-group ×1