android,implements OnTouchListener....public .. onTouch(View v, /////触摸屏幕怎么不显示提示呢?? 10
publicclassMainActivityextendsActivityimplementsOnTouchListener{privateTextViewsunCal...
public class MainActivity extends Activity implements OnTouchListener {
private TextView sunCal, lunarCal, updateTime, realTemp, realWeather;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
sunCal = (TextView) findViewById(R.id.sunCal);
lunarCal = (TextView) findViewById(R.id.lunarCal);
updateTime = (TextView) findViewById(R.id.updateTime);
realTemp = (TextView) findViewById(R.id.realTemp);
realWeather = (TextView) findViewById(R.id.realWeather);
}
@Override
public boolean onTouch(View v, MotionEvent event) {
Toast.makeText(this, "发生触摸事件", Toast.LENGTH_LONG).show(); /////触摸屏幕怎么不显示提示呢??
return true;
}
} 展开
private TextView sunCal, lunarCal, updateTime, realTemp, realWeather;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
sunCal = (TextView) findViewById(R.id.sunCal);
lunarCal = (TextView) findViewById(R.id.lunarCal);
updateTime = (TextView) findViewById(R.id.updateTime);
realTemp = (TextView) findViewById(R.id.realTemp);
realWeather = (TextView) findViewById(R.id.realWeather);
}
@Override
public boolean onTouch(View v, MotionEvent event) {
Toast.makeText(this, "发生触摸事件", Toast.LENGTH_LONG).show(); /////触摸屏幕怎么不显示提示呢??
return true;
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询