0
Google map
을 Activity
에 삽입하려고합니다. 나는 몇 번 전에 그것을 통합했지만 그것은 지금 일어나지 않고있다. 내 레이아웃 파일 :Google map fragment가 null입니까?
<fragment
android:id="@+id/location_map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="right|center_vertical" />
지도 클래스
@EActivity(R.layout.location_activity)
public class FIndLocationActivity extends AppCompatActivity implements OnMapReadyCallback {
@AfterExtras
void afterViewCreated() {
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.location_map);
mapFragment.getMapAsync(this);
.....
.....
}
}
mapFragment
항상 Null
남아있다. 여기서 내가 뭘 잘못하고 있니? 나도 this 튜토리얼을 따라 갔지만 여전히 null을 던지고있다. 나는 실제 장치를 사용하여 응용 프로그램을 테스트하고 있습니다.
** ** 어디에서 ** null을 던지고 있습니까? 지도에 대한 참조가 없습니다. 둘째, 네, 맵은'OnMapReadyCallback'이 끝날 때까지 null이 될 것입니다. ... 아니면 조각을 의미합니까? –
Mapframent가 null입니다. –
'@ AfterExtras' 주석은 무엇을하는지 모르지만 그 XML 파일은 어떻게이 Activity로로드됩니까? –