0

LocationManager の動作を変更したいのですが、そのコンストラクターが表示されないため、Eclipse で拡張が許可されません。

それはできますか?

もしそうなら、どうすれば上記の問題を回避できますか?それから、どうすればインスタンス化できますか? (または、システムに LocationManager として使用させますか?)

ありがとう

4

1 に答える 1

1

ソースは次のとおりです。

/**
 * @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;
}

コメントに注意してください。Context.getSystemService を使用します。

于 2011-05-07T07:28:00.813 に答える