1. Download our Official Android App: Forums for Android!

Apps after i make drawer menu and floating button why my maps can't get my location and location button n

Discussion in 'Android Development' started by eggys, May 2, 2016.

  1. eggys

    eggys Lurker
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    1
    Joined:
    May 2, 2016

    May 2, 2016
    1
    0
    15
    Male
    Bandung
    after i make drawer menu and floating button why my maps can't get my location and location button not show, and why the search place button when it clicked so that force stop? before i add drawer menu and floating button, it's all okay..

    picture before adding [​IMG]
    picture after adding [​IMG]

    activity_main.xml
    Code (Text):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    3.     xmlns:tools="http://schemas.android.com/tools"
    4.     xmlns:app="http://schemas.android.com/apk/res-auto"
    5.     tools:context="com.emergency.MainActivity"
    6.     android:layout_width="match_parent"
    7.     android:layout_height="match_parent"
    8.     android:id="@+id/drawerLayout">
    9.  
    10.     <LinearLayout
    11.         android:layout_width="match_parent"
    12.         android:layout_height="match_parent"
    13.         android:orientation="vertical">
    14.         <android.support.design.widget.AppBarLayout
    15.             android:layout_width="match_parent"
    16.             android:layout_height="wrap_content"
    17.             android:fitsSystemWindows="true">
    18.             <android.support.v7.widget.Toolbar
    19.                 android:layout_width="match_parent"
    20.                 android:layout_height="wrap_content"
    21.                 android:orientation="horizontal"
    22.                 android:id="@+id/toolbar">
    23.             </android.support.v7.widget.Toolbar>
    24.         </android.support.design.widget.AppBarLayout>
    25.         <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    26.             xmlns:fab="http://schemas.android.com/apk/res-auto"
    27.             android:background="@color/background"
    28.             android:layout_width="match_parent"
    29.             android:layout_height="match_parent">
    30.  
    31.             <include layout="@layout/activity_maps"/>
    32.  
    33.             <com.getbase.floatingactionbutton.FloatingActionsMenu
    34.                 android:id="@+id/multiple_actions"
    35.                 android:layout_width="wrap_content"
    36.                 android:layout_height="wrap_content"
    37.                 android:layout_alignParentBottom="true"
    38.                 android:layout_alignParentRight="true"
    39.                 android:layout_alignParentEnd="true"
    40.                 fab:fab_addButtonColorNormal="@color/white"
    41.                 fab:fab_addButtonColorPressed="@color/white_pressed"
    42.                 fab:fab_addButtonPlusIconColor="@color/half_black"
    43.                 fab:fab_labelStyle="@style/menu_labels_style"
    44.                 android:layout_marginBottom="50dp"
    45.                 android:layout_marginRight="16dp"
    46.                 android:layout_marginEnd="16dp">
    47.  
    48.                 <com.getbase.floatingactionbutton.FloatingActionButton
    49.                     android:id="@+id/action_a"
    50.                     android:layout_width="wrap_content"
    51.                     android:layout_height="wrap_content"
    52.                     fab:fab_colorNormal="@color/white"
    53.                     fab:fab_title="Tambal Ban"
    54.                     fab:fab_colorPressed="@color/white_pressed"
    55.                     fab:fab_size="mini"/>
    56.                 <com.getbase.floatingactionbutton.FloatingActionButton
    57.                     android:id="@+id/action_b"
    58.                     android:layout_width="wrap_content"
    59.                     android:layout_height="wrap_content"
    60.                     fab:fab_colorNormal="@color/white"
    61.                     fab:fab_title="ATM"
    62.                     fab:fab_colorPressed="@color/white_pressed"
    63.                     fab:fab_size="mini"/>
    64.                 <com.getbase.floatingactionbutton.FloatingActionButton
    65.                     android:id="@+id/action_c"
    66.                     android:layout_width="wrap_content"
    67.                     android:layout_height="wrap_content"
    68.                     fab:fab_colorNormal="@color/white"
    69.                     fab:fab_title="WC Umum"
    70.                     fab:fab_colorPressed="@color/white_pressed"
    71.                     fab:fab_size="mini"/>
    72.  
    73.             </com.getbase.floatingactionbutton.FloatingActionsMenu>
    74.  
    75.         </RelativeLayout>
    76.     </LinearLayout>
    77.  
    78.     <android.support.design.widget.NavigationView
    79.         android:id="@+id/navigationView"
    80.         android:layout_width="280dp"
    81.         android:layout_height="match_parent"
    82.         app:headerLayout="@layout/header_menu"
    83.         app:menu="@menu/menu_navigasi"
    84.         android:layout_gravity="start">
    85.         <!--perintah buat nampilin menu utama kemudian bisa di slide yang ada menu adalah yang layout_gravity-->
    86.  
    87.  
    88.     </android.support.design.widget.NavigationView >
    89. </android.support.v4.widget.DrawerLayout>

    activity_maps.xml
    Code (Text):
    1. <RelativeLayout
    2.     xmlns:android="http://schemas.android.com/apk/res/android"
    3.     xmlns:tools="http://schemas.android.com/tools"
    4.     android:layout_width="match_parent"
    5.     android:layout_height="match_parent">
    6.  
    7.     <LinearLayout
    8.         android:id="@+id/header_tempat"
    9.         android:layout_width="match_parent"
    10.         android:layout_height="match_parent">
    11.         <fragment
    12.         android:id="@+id/map"
    13.         android:name="com.google.android.gms.maps.SupportMapFragment"
    14.         android:layout_width="wrap_content"
    15.         android:layout_height="wrap_content"
    16.         tools:context="com.emergency.MapsActivity" />
    17.     </LinearLayout>
    18.     <Button
    19.         android:id="@+id/Bsearch"
    20.         android:layout_width="match_parent"
    21.         android:layout_height="wrap_content"
    22.         android:background="#ff4081"
    23.         android:src="@android:drawable/ic_dialog_map"
    24.         android:text="Search Place"
    25.         android:textColor="#fff"
    26.         android:layout_alignParentBottom="true"
    27.         android:layout_alignParentRight="true"
    28.         android:onClick="onSearch"
    29.         />
    30.  
    31. </RelativeLayout>
     

    Advertisement

  2. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,275
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,275
    10,375
    1,988
    Male
    Software developer
    South West of England

Share This Page

Loading...