如果我的主要活动是FragmentActivity,我的android应用程序会崩溃。
关于如何解决此问题的任何想法?
public class MainActivity extends FragmentActivity {
//...
}
答案 0 :(得分:0)
事实证明我只需将我的片段包装在activity_main.xml
中<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"/>
</LinearLayout>