80,472
社区成员




public class MainActivity extends Activity implements OnTouchListener, OnGestureListener {
TextView t;
private GestureDetector mGestureDetector;
@SuppressWarnings("deprecation")//
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
t=(TextView)findViewById(R.id.text);
mGestureDetector = new GestureDetector(this); //这里会被横线划掉,是不是不能用了?有什么解决办法?
t.setOnTouchListener(this);
t.setFocusable(true);
t.setClickable(true);
t.setLongClickable(true);
mGestureDetector.setIsLongpressEnabled(true);
}