diff --git a/app/src/main/java/spider65/ebike/tsdz2_esp32/MainActivity.java b/app/src/main/java/spider65/ebike/tsdz2_esp32/MainActivity.java index 5c1f3d6..54c51cc 100644 --- a/app/src/main/java/spider65/ebike/tsdz2_esp32/MainActivity.java +++ b/app/src/main/java/spider65/ebike/tsdz2_esp32/MainActivity.java @@ -114,7 +114,7 @@ protected void onCreate(Bundle savedInstanceState) { mainPagerAdapter = new MainPagerAdapter(this, status); ViewPager2 viewPager = findViewById(R.id.view_pager); viewPager.setAdapter(mainPagerAdapter); - viewPager.setOnTouchListener(this); + viewPager.getChildAt(0).setOnTouchListener(this); viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() { @Override