Blackberry OS6:在扩展的MapLocation类上实现click事件

时间:2012-03-30 21:14:24

标签: blackberry blackberry-simulator blackberry-os6

我需要更改当用户点击RichMapField中的引脚时发生的情况,并且这些引脚恰好是MapLocation对象,这些MapLocations还可以选择性地处理称为“Partner”类的不同数据类型,其中包含ID,Address ,标签,纬度和经度。

一切都运行得很好,因为当你将鼠标悬停在别针上时,它仍然会给出标签等等,但是当你点击它时,什么都不做。

此行为是预期的!所以到目前为止,一切都很顺利。

我似乎无法弄清楚,如何将点击或触控侦听器附加到新的自定义MapLocation对象。

继承了代码而没有进一步的adu:

import net.rim.device.api.lbs.maps.model.MapLocation;
import net.rim.device.api.ui.component.Dialog;

public class CustomMapLocation extends MapLocation {

    private Partner partner;

    public KRMapLocation(double lat, double lon, String label, String address) {
         setLat(lat);
         setLon(lon);
         setName(label);
         setDescription(address);
    }

    public KRMapLocation(Partner p) {
        this.partner = p;
        setLat(partner.getLatitude());
        setLon(partner.getLongitude());
        setName(partner.getName());
        setDescription(partner.getAddress());
    }

    // this does nothing...
    protected boolean trackwheelClick(int status, int time) {
        Dialog.alert("Trackwheel click");
        return true;
    }

}

这是我要弄清楚的最后一件事,是Touch和Trackwheel听众。任何一个或两个的帮助都会很棒......我已经谷歌干了,到现在谷歌的东西我是某种黑莓粉丝lol

最后的家伙,我希望有人可以帮助我!

(我知道这是可能的,因为它曾经有一个打开详细页面的点击事件,我只是不知道该做什么,甚至不知道我应该寻找什么。)

1 个答案:

答案 0 :(得分:1)

我的猜测是,不是处理点击的MapLocation。它由字段处理,它使用MapLocation数据来获取坐标,标签等。我也没有找到合适的钩子。至少能够扩展出现的默认详细信息对话框会很好。

相关问题