android 触摸长按事件,android中的长按事件与触摸事件

package com.rfstar.clicktest;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import android.view.MotionEvent;

import android.view.View;

import android.widget.Button;

import android.widget.LinearLayout;

import android.widget.TextView;

import android.widget.Toast;

public class MainActivity extends AppCompatActivity

{

private Button button;

private TextView textView;

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

LinearLayout linearLayout=(LinearLayout)findViewById(R.id.liner_click);

button = (Button) findViewById(R.id.button_click);

textView = (TextView) findViewById(R.id.text_click);

linearLayout.setOnLongClickListener(new Vie

你可能感兴趣的:(android,触摸长按事件)