Touch event.getAction does not work under service class in android studio
问题 I developed an App to collect touch events under the foreground service class. The app has a main activity to input user's information (e.g., name and age). Then a foreground service starts to collect touch events, and a notification is launched to inform the user that the service is running. This is the main activity code public class MainActivity extends AppCompatActivity implements View.OnClickListener { @Override public boolean onOptionsItemSelected(MenuItem item) { Intent intent; switch