开发者

Override LocationManager?

I'd like to change the behaviour of LocationManager, but its constructor isn't visible, so Eclipse won't allow extending it.

Can it be done?

If so, how do I get around the above issue, and then, how do I 开发者_JAVA百科instantiate it? (Or have the system use it as the LocationManager?)

Thanks


Here's the source:

/**
 * @hide - hide this constructor because it has a parameter
 * of type ILocationManager, which is a system private class. The
 * right way to create an instance of this class is using the 
 * factory Context.getSystemService.
 */
public LocationManager(ILocationManager service) {
    if (Config.LOGD) {
        Log.d(TAG, "Constructor: service = " + service);
    }
    mService = service;
}

Notice the comment. Use Context.getSystemService.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜