문제

Google Play 위치 서비스를 사용하여 문제가 있습니다.나는 http://developer.android.com/training/location/을 따르려고했습니다.retrieve-current.html 다소그러나 Eclipse는 내 위치 정보를 해결할 수 없다고 알려줍니다.내 코드는 다음과 같습니다 :

    @Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    overridePendingTransition(0,0);

    mLocationClient = new LocationClient(this, this, this); 


    if (savedInstanceState == null) {
        getSupportFragmentManager().beginTransaction()
                .add(R.id.container, new PlaceholderFragment()).commit();
    }
}

@Override
protected void onStart() {
    super.onStart();
    // Connect the client.
    mLocationClient.connect();
}
.

Google-Play-Services 라이브러리가 올바르게 참조되지 않지만 내 프로젝트의 속성에 도착했을 때 그 옆에 녹색 체크 표시가 있습니다.더 많은 코드가 필요하면 알려주십시오.미리 감사드립니다!

도움이 되었습니까?

해결책

프로젝트를 닫고 다시 열

프로젝트를 청소하고 다시 작성하십시오.

Activity 클래스에 올바른 가져 오기를 추가했는지 확인하십시오.

개인 위치 클라이언트 mlocationclient가 있는지 확인하십시오.귀하의 활동에 정의되어 있습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top