extends Overlay 로 되어진 클레스에서 Geocoder coder = new Geocoder(this) 라고 하면 this 부분이
에러가 나서 다른 Activity클레스에서 함수를 만들어서
사용하니 컴파일 상은 문제가 없는데 구동시에 에러가 남니다..
즉....예를 들어
public class test extends Activity 클레스에 함수를
public String GetAddress(double gps_x, double gps_y)
{
String addLine = null;
Geocoder coder = new Geocoder(this);
try {
Iterator<Address> addresses = coder.getFromLocation(gps_x/1E6, gps_y/1E6, 3).iterator();
if (addresses != null) {
.
.
.
.
}
} catch (IOException e) {
Log.e("GPS", "Failed to get address", e);
}
return addLine;
}
이런식으로 선언을 하고
public class test2 extends Overlay {
test addr = new test();
String addrs = addr.GetAddress(x, y);
.
.
.
.
로 사용을 하니 에러가 납니다.
몇일째 사질을 하는데도...ㅠㅠ
혹시 아시는 분계시면 답변부탁드리겟습니다. ㅜㅜ