Android Permissions at Run Time with fragments -
i have in project activity has 2 fragments in xml (main):
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="com.example.fragments.mainactivity"> <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.mapfragment" /> <fragment android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent" class="com.example.list" /> </relativelayout>
so can see, 1 of them map fragment. problem when setcontentview()
running, app crashes above api 23. tried doing (location) permissions checks before setcontentview()
, using documantation , app still crashes. idea?
try change code in way:
<fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" android:name="com.google.android.gms.maps.supportmapfragment"/>
Comments
Post a Comment