使用touchListener和clickListener处于突出显示状态的左侧按钮
执行以下操作后,我的按钮保持在突出显示状态时出现问题: public class MainActivity extends AppCompatActivity { @SuppressLint("ClickableViewAccessibility") @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); AppCompatButton button = (AppCompatButton) findViewById(R.id.mybutton); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d("Test", "calling onClick"); } }); button.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: …