public class LocationFragment extends Fragment {
GoogleMap googleMap=null;
Location_Manager lm=new Location_Manager();
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_location, container, false);
googleMap=lm.init();
return v;
}
}
이게 프래그먼트 클래스이고 여기서 Location_Manager객체를 불러오면
public class Location_Manager extends FragmentActivity{
GoogleMap googleMap=null;
FragmentManager fm;
SupportMapFragment smf;
Handler handler=new Handler();
public Location_Manager() {
// TODO Auto-generated constructor stub
}
public GoogleMap init(){
fm=getSupportFragmentManager();
smf = (SupportMapFragment) fm.findFragmentById(R.id.google_map);
new Handler().postDelayed(new Runnable(){
@Override
public void run() {
// TODO Auto-generated method stub
googleMap =smf.getMap();
googleMap.addMarker(new MarkerOptions().position(new LatLng(37, 123)).title("sample"));
}
}, 500);
return googleMap;
}
}
이렇게 하는방식인데
Stackover에서 찾아보고 했는데 핸들러를 쓰라고 해서 해봤는데도 안되고
Supportfragment로 바꿔보기도하고 해도 안됩니다 조언좀 부탁드립니다.