点击图片然后换成另一个图片

boolean Change = true;
one.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (Change){
                    one.setImageDrawable(getResources().getDrawable(R.drawable.one));
                }else
                    one.setImageDrawable(getResources().getDrawable(R.drawable.fone));
                Level_String = "1";
                Change = !Change;
            }
        });

 

你可能感兴趣的:(Android)