给你举个例子吧,获得别的XML的buttonView view=LayoutInflater.from(this).inflate(R.layout.activity_selecting_address_item, null);Button btn=(Button) view.findViewById(R.id.other);R.id.other是别的XML中的ID