0
私の問題は何か分かりませんが、これはうまくいきます。だから私は、このActivityクラスのMainMapActivityandroid.view.InflateException:クラス・フラグメントを拡張するエラー
public class MainMapActivity extends AppCompatActivity implements OnMapReadyCallback {
private GoogleMap mMap;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_nav);
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
activity_main_nav
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include xmlns:android="http://schemas.android.com/apk/res/android"
layout="@layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include
layout="@layout/activity_main_map"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="@layout/nav_header_main"
app:menu="@menu/activity_main_drawer" />
と含ま
activity_main_map<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="15dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="15dp"
android:name="com.google.android.gms.maps.SupportMapFragment"/>
誰か缶を持っています私の問題を助けてくれますか?私はひどく答えが必要です。ありがとう!
こんにちは@san私は既に私のコードを変更しない別のデバイスから私のプロジェクトを実行しようとしました。それはSamsung Androidバージョン5.1.1で正常に動作します。しかし、私の携帯電話はAsusと、5.1.1のAndroidのバージョンはなぜ私がAsus上で私のアプリケーションを実行すると、そのエラーを示しているのですか?しかし、4.4.2のAndroidバージョンを搭載した他のブランドの携帯電話でも、正常に動作します。 – tin
あなたは何らかの理由で私がそのエラーに遭遇した理由を知っていますか? – tin
Androidは不思議なやり方で動作し、それぞれのデバイスメーカーはGoogleの処女OSに自分の編集を重ね合わせて独自のバージョンのOSを作成し、一部は自分の仕事ではあまりにも恥ずかしいかもしれません。それが奇妙な行動の理由かもしれない。あなたが私に完全なスタックトレースを送ることができるなら、私はあなたをもっと助けることができるでしょう... – San