frament中不能调用getSystemService()方法 本帖最后由 qq271967835 于 2014-05-13 22:21:52 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 LayoutInflater inflater = (LayoutInflater)getActivity(). getSystemService(Context.LAYOUT_INFLATER_SERVICE);//(该行getSystemService()编译出错 ),我之前是这么弄得,你试试吧,不行我也不会了,我刚刚学这个 使用context调用getSystemService,先获取Context 你的public boolean onFling(MotionEvent arg0, MotionEvent arg1, float arg2,float arg3) {// TODO Auto-generated method stubreturn false;}滑动没实现,所以没有滑动效果 除了重载 onFling(MotionEvent arg0, MotionEvent arg1, float arg2,float arg3)还要重载public boolean onTouchEvent(MotionEvent event) { // TODO Auto-generated method stub return this.detector.onTouchEvent(event); }这样就使得detector能接受消息响应了。 detector指的是GestureDetector类型的变量,也就是你程序的mGestureDetector 有没有安卓开发环境一键搭建包? Android 基于基站做到手机定位,获取经纬度? 看不懂贪吃蛇中的tileview,求高手解释 webview 怎么实现window.open 创建新窗口的 流媒体播放问题,急急急!!! 手机上如何打包apk文件? 求大神帮忙整个作业,可付款 安卓程序混淆打包问题 新手提问——望大神帮忙 android开发中,如果一个按键足够大,划屏时,不小心手在按键里边,这时怎么实现划屏,而不触发按键事 Java 专利侵权案:甲骨文赢得对谷歌的上诉将引发什么问题?? 微信里的网页,可有办法读取当前的微信号?
float arg3) {
// TODO Auto-generated method stub
return false;
}滑动没实现,所以没有滑动效果
float arg3)还要重载
public boolean onTouchEvent(MotionEvent event) {
// TODO Auto-generated method stub
return this.detector.onTouchEvent(event);
}
这样就使得detector能接受消息响应了。