android

来源:网络 责任编辑:栏目编辑 发表时间:2013-07-01 22:19 点击:

 

/**

     * This is class for touch event ,when user touched the screen for 

     * enough time, user can tag the touched place as user's favorite

     * place, or fix current position and set as destination.

     * @author xinyan

     *@date 2011-10-10

     */ 

    class Touchy extends Overlay { 

 

        @Override 

        public boolean onTouchEvent(MotionEvent e, MapView mapView) { 

            Log.v(TAG, "Touchy is touched..."); 

            if (MotionEvent.ACTION_DOWN == e.getAction()) { 

                start = e.getEventTime(); 

                x = (int) e.getX(); 

                y = (int) e.getY(); 

                touchPoint = mMapView.getProjection().fromPixels(x, y); 

                Log.v(TAG, "Touchy is touched.. and we get touch point."); 

            } 

            if (MotionEvent.ACTION_UP == e.getAction()) { 

                stop = e.getEventTime(); 

            } 

            if (stop - start > 1500) { 

                OverlayItem overlayItem = new OverlayItem(touchPoint, 

                        "Pined position", "A new position"); 

                CustomPinpoint custom = new CustomPinpoint(marker, 

                        StandardActivity.this); 

                custom.insertPinpoint(overlayItem); 

                mMapView.getOverlays().add(custom); 

 

                new AlertDialog.Builder(StandardActivity.this) 

                        .setIcon(null) 

                        .setTitle(R.string.whatYouWant) 

                        .setSingleChoiceItems( 

                       

    相关新闻>>

      发表评论
      请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
      用户名: 验证码:点击我更换图片
      最新评论 更多>>

      推荐热点

      • Android 完全退出程序
      • 原创:Android应用开发-Andorid歌词秀,含源码
      • android 屏幕保护
      • Android手机软件汉化教程---第四课 dex文件汉化
      • 众多Android 开源项目推荐,给力工作给力学习
      • Android Audio代码分析4
      • Android得到已安装的应用程序信息!
      • Android开发者指南(29) —— USB Host and Accessory
      • Android成长的幕后推手:工程师鲁宾
      网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
      Copyright © 2008-2015 计算机技术学习交流网. 版权所有

      豫ICP备11007008号-1