-3

如果我的主要活动是 FragmentActivity,我的 android 应用程序会崩溃。

有想法该怎么解决这个吗?

public class MainActivity extends FragmentActivity {
//...
}
4

1 回答 1

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>
于 2013-01-02T07:32:12.747 回答