Error in displying Google Map in android studio. With API 22 and 15 (on real devices)
<p>I am Using Android Studio to display My Current location on Google Map.But getting following Errors:</p>

<hr>

<pre><code> 03-12 16:01:32.865 745-745/? E/WifiTrafficPoller: TRAFFIC_STATS_POLL true Token 612 num clients 12
03-12 16:01:32.867 745-745/? E/WifiTrafficPoller:  packet count Tx=438171 Rx=559652
</code></pre>

<hr>

<pre><code>  03-12 16:01:13.268 745-1041/? E/WifiConfigStore: updateConfiguration freq=2462 BSDID **'My_broadband_name'('Provider_name'Broadband)"WPA_PSK
</code></pre>

<p>I know this type of question is asked <a href="https://stackoverflow.com/questions/31342684/getting-error-could-not-find-class-android-app-appopsmanager-referenced-from">here</a> and <a href="https://stackoverflow.com/questions/29815177/could-not-find-class-android-app-appopsmanager-referenced-from-method-com-goo">here</a> but both the solution didnt worked for me.</p>

<p>My New logcat</p>

<hr>

<pre><code>03-12 16:01:34.841 15673-15673/? D/ActivityThread: SVC-Creating service: CreateServiceData{token=android.os.BinderProxy@18499a06 className=com.google.android.gms.usagereporting.service.UsageReportingService packageName=com.google.android.gms intent=null}
03-12 16:01:34.842 15673-15673/? D/ActivityThread: SVC-CREATE_SERVICE handled : 0 / CreateServiceData{token=android.os.BinderProxy@18499a06 className=com.google.android.gms.usagereporting.service.UsageReportingService packageName=com.google.android.gms intent=null}
03-12 16:01:34.845 15673-15673/? D/ActivityThread: SVC-BIND_SERVICE handled : 0 / BindServiceData{token=android.os.BinderProxy@18499a06 intent=Intent { act=com.google.android.gms.usagereporting.service.START pkg=com.google.android.gms }}
03-12 16:01:34.848 15673-20095/? I/EventLogService: Aggregate from 1457776884258 (log), 1457776884258 (data)
03-12 16:01:34.869 745-745/? E/WifiTrafficPoller: TRAFFIC_STATS_POLL false Token 613 num clients 12
03-12 16:01:34.873 745-1125/? D/SettingsProvider: lookupValue table global cache.fullyMatchesDisk() dropbox:event_data
03-12 16:01:34.873 745-1125/? V/SettingsInterface:  from settings cache , name = dropbox_age_seconds , value = null
03-12 16:01:34.873 745-1125/? V/SettingsInterface:  from settings cache , name = dropbox_max_files , value = null
03-12 16:01:34.873 745-1125/? V/SettingsInterface:  from settings cache , name = dropbox_quota_percent , value = null
03-12 16:01:34.873 745-1125/? V/SettingsInterface:  from settings cache , name = dropbox_reserve_percent , value = null
03-12 16:01:34.873 745-1125/? V/SettingsInterface:  from settings cache , name = dropbox_quota_kb , value = null
03-12 16:01:34.878 745-745/? V/ActivityManager: Broadcast: Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } ordered=false userid=0 callerApp=ProcessRecord{2b0d0f73 745:system/1000}
03-12 16:01:34.879 745-1541/? D/ActivityManager: getContentProviderImpl: from caller=android.app.ApplicationThreadProxy@3701a03e (pid=15673, userId=0) to get content provider com.google.android.gsf.gservices cpr=ContentProviderRecord{3ea7e70a u0 com.google.android.gsf/.gservices.GservicesProvider}
03-12 16:01:34.880 745-1541/? I/libPerfService: perfSetFavorPid - pid:1706, 6aa
03-12 16:01:34.882 15673-20095/? D/ActivityThread: hoder:android.app.IActivityManager$ContentProviderHolder@147fdef4,provider,holder.Provider:android.content.ContentProviderProxy@1518761d
03-12 16:01:34.886 745-1734/? I/libPerfService: perfSetFavorPid - pid:1706, 6aa
03-12 16:01:34.890 745-773/? I/AlarmManager: pkg : com.google.android.gms set alarm
03-12 16:01:34.890 745-773/? I/AlarmManager: This com.google.android.gms is system app return trust.
03-12 16:01:34.890 745-773/? V/AlarmManager: isAlarmNeedAlign : charging
03-12 16:01:34.890 745-773/? V/AlarmManager: set(PendingIntent{18784e9f: PendingIntentRecord{1d3cfc11 com.google.android.gms broadcastIntent}}) : type=0 triggerAtTime=1457780494888 win=-1 tElapsed=251243734 maxElapsed=252593734 interval=1800000 standalone=false intent=Intent { cmp=com.google.android.gms/.checkin.EventLogService$Receiver } this alarm will trigger at  heuristic time= 0 : 52 : 29 later
03-12 16:01:34.890 745-773/? D/AlarmManager: remove(operation) changed bounds; rebatching
03-12 16:01:34.890 745-773/? V/AlarmManager: isAlarmNeedAlign : charging
03-12 16:01:34.891 745-773/? V/AlarmManager: isAlarmNeedAlign : charging
03-12 16:01:34.891 745-773/? V/AlarmManager: isAlarmNeedAlign : charging
03-12 16:01:34.891 745-773/? V/AlarmManager: isAlarmNeedAlign : charging
03-12 16:01:34.891 745-773/? V/AlarmManager: isAlarmNeedAlign : charging
03-12 16:01:34.891 745-773/? V/AlarmManager: isAlarmNeedAlign : charging
03-12 16:01:34.891 745-773/? V/AlarmManager: isAlarmNeedAlign : charging

03-12 16:01:34.896 745-773/? V/AlarmManager: isAlarmNeedAlign : charging
03-12 16:01:34.897 15673-15673/? D/ActivityThread: SVC-Destroying service: com.google.android.gms.checkin.EventLogService@1049e05c
03-12 16:01:34.898 745-1126/? D/PowerManagerNotifier: onWakeLockReleased: flags=1, tag="Event Log Service", packageName=com.google.android.gms, ownerUid=10007, ownerPid=15673, workSource=WorkSource{10007 com.google.android.gms}
03-12 16:01:34.898 745-1126/? D/PowerManagerService: mDisplayPowerRequest.policy = 0
03-12 16:01:34.898 745-1126/? D/PowerManagerService: isWfdEnabled() mWfdStatus=WifiDisplayStatus{featureState=2, scanState=0, activeDisplayState=0, activeDisplay=null, displays=[], sessionInfo=WifiDisplaySessionInfo: C/O:Client,GId:,Pp:,SId:0,IP:}, return false
03-12 16:01:34.898 745-1126/? I/PowerManagerService: setBrightness mButtonLight 0.
03-12 16:01:34.898 15673-15673/? D/ActivityThread: SVC-STOP_SERVICE handled : 0 / android.os.BinderProxy@250d9ecf
03-12 16:01:34.899 745-1681/? I/libPerfService: perfSetFavorPid - pid:1706, 6aa
03-12 16:01:35.812 745-1031/? I/AlarmManager: triggerAlarmsLocked: head of list: 249444659 nowELAPSED: 249444659 will sending alarm Batch size=1
03-12 16:01:35.812 745-1031/? V/AlarmManager: isAlarmNeedAlign : charging
03-12 16:01:35.812 745-1031/? I/AlarmManager: isRepeatingAlarmAllowed() in
03-12 16:01:35.813 745-1031/? I/AlarmManager: pkg : com.domobile.applock mWakefulness=false mIsPowerConnected=true
03-12 16:01:35.813 745-1031/? D/AlarmManager: set alarm to RTC 249445659
03-12 16:01:35.813 745-1031/? W/AlarmManager: triggerAlarmsLocked: head of list: 249445659 nowELAPSED: 249444659 =&gt; not fire alarm in the future
03-12 16:01:35.813 745-1031/? V/AlarmManager: Triggering alarm #0: Alarm{1281bec type 3 when 249444659 com.domobile.applock}
03-12 16:01:36.748 745-745/? V/SettingsInterface:  from settings cache , name = sys_free_storage_log_interval , value = null
03-12 16:01:36.748 745-745/? V/SettingsInterface:  from settings cache , name = disk_free_change_reporting_threshold , value = null
03-12 16:01:36.812 745-1031/? I/AlarmManager: triggerAlarmsLocked: head of list: 249445659 nowELAPSED: 249445659 will sending alarm Batch size=1
03-12 16:01:36.813 745-1031/? V/AlarmManager: isAlarmNeedAlign : charging
03-12 16:01:36.813 745-1031/? I/AlarmManager: isRepeatingAlarmAllowed() in
03-12 16:01:36.813 745-1031/? I/AlarmManager: pkg : com.domobile.applock mWakefulness=false mIsPowerConnected=true
03-12 16:01:36.813 745-1031/? D/AlarmManager: set alarm to RTC 249446659
03-12 16:01:36.813 745-1031/? W/AlarmManager: triggerAlarmsLocked: head of list: 249446659 nowELAPSED: 249445659 =&gt; not fire alarm in the future
03-12 16:01:36.814 745-1031/? V/AlarmManager: Triggering alarm #0: Alarm{3b1dfbb5 type 3 when 249445659 com.domobile.applock}
03-12 16:01:36.814 745-1031/? V/AlarmManager: sending alarm Alarm{1281bec type 3 when 249444659 com.domobile.applock} , intent = Intent { cmp=com.domobile.applock/.service.LockService }
03-12 16:01:36.814 745-1031/? I/ActivityManager: [Background Service Priority Adjustment] Set callerFg as false for service.getFlags():260
03-12 16:01:36.816 1806-1806/? D/ActivityThread: SVC-Calling onStartCommand: com.domobile.applock.service.LockService@1fe00534, flags=0, startId=51245
03-12 16:01:36.816 1806-1806/? D/ActivityThread: SVC-SERVICE_ARGS handled : 0 / ServiceArgsData{token=android.os.BinderProxy@160d4646 startId=51245 args=Intent { flg=0x104 cmp=com.domobile.applock/.service.LockService (has extras) }}
03-12 16:01:36.817 745-745/? D/AlarmManager: onSendFinished begin
03-12 16:01:36.817 745-1031/? D/PowerManagerService: mDisplayPowerRequest.policy = 0
03-12 16:01:36.818 745-1031/? D/PowerManagerService: isWfdEnabled() mWfdStatus=WifiDisplayStatus{featureState=2, scanState=0, activeDisplayState=0, activeDisplay=null, displays=[], sessionInfo=WifiDisplaySessionInfo: C/O:Client,GId:,Pp:,SId:0,IP:}, return false
03-12 16:01:36.819 745-1031/? I/PowerManagerService: setBrightness mButtonLight 0.
03-12 16:01:36.819 745-1031/? D/PowerManagerNotifier: onWakeLockAcquired: flags=1, tag="*alarm*", packageName=android, ownerUid=1000, ownerPid=745, workSource=WorkSource{10124}
03-12 16:01:36.820 745-1031/? V/AlarmManager: sending alarm Alarm{3b1dfbb5 type 3 when 249445659 com.domobile.applock} , intent = Intent { cmp=com.domobile.applock/.service.LockService }
03-12 16:01:36.820 745-1031/? I/ActivityManager: [Background Service Priority Adjustment] Set callerFg as false for service.getFlags():260
03-12 16:01:36.821 1806-1806/? D/ActivityThread: SVC-Calling onStartCommand: com.domobile.applock.service.LockService@1fe00534, flags=0, startId=51246
03-12 16:01:36.822 1806-1806/? D/ActivityThread: SVC-SERVICE_ARGS handled : 0 / ServiceArgsData{token=android.os.BinderProxy@160d4646 startId=51246 args=Intent { flg=0x104 cmp=com.domobile.applock/.service.LockService (has extras) }}
03-12 16:01:36.823 745-745/? I/AlarmManager: ResultReceiver =&gt; mBroadcastRefCount: 1
03-12 16:01:36.824 745-745/? D/AlarmManager: onSendFinished begin
03-12 16:01:36.824 745-745/? I/AlarmManager: ResultReceiver =&gt; mBroadcastRefCount: 0
03-12 16:01:36.824 745-745/? D/PowerManagerNotifier: onWakeLockReleased: flags=1, tag="*alarm*", packageName=android, ownerUid=1000, ownerPid=745, workSource=WorkSource{10124}
03-12 16:01:36.824 745-745/? D/PowerManagerService: mDisplayPowerRequest.policy = 0
03-12 16:01:36.824 745-745/? D/PowerManagerService: isWfdEnabled() mWfdStatus=WifiDisplayStatus{featureState=2, scanState=0, activeDisplayState=0, activeDisplay=null, displays=[], sessionInfo=WifiDisplaySessionInfo: C/O:Client,GId:,Pp:,SId:0,IP:}, return false
03-12 16:01:36.825 745-745/? I/PowerManagerService: setBrightness mButtonLight 0.
03-12 16:01:37.812 745-1031/? I/AlarmManager: triggerAlarmsLocked: head of list: 249446659 nowELAPSED: 249446659 will sending alarm Batch size=1
03-12 16:01:37.813 745-1031/? V/AlarmManager: isAlarmNeedAlign : charging
03-12 16:01:37.813 745-1031/? I/AlarmManager: isRepeatingAlarmAllowed() in
03-12 16:01:37.813 745-1031/? I/AlarmManager: pkg : com.domobile.applock mWakefulness=false mIsPowerConnected=true
03-12 16:01:37.814 745-1031/? D/AlarmManager: set alarm to RTC 249447659
03-12 16:01:37.814 745-1031/? W/AlarmManager: triggerAlarmsLocked: head of list: 249447659 nowELAPSED: 249446659 =&gt; not fire alarm in the future
03-12 16:01:37.814 745-1031/? V/AlarmManager: Triggering alarm #0: Alarm{3173824a type 3 when 249446659 com.domobile.applock}
03-12 16:01:38.390 279-279/? I/thermal_repeater: oh, queryMdThermalInfo (0)Bad file number
03-12 16:01:38.423 279-279/? I/thermal_repeater: [recvMdThermalInfo] ret=30, strLen=127,  2, 32767, -127, -1, 32767, 18
03-12 16:01:38.812 745-1031/? I/AlarmManager: triggerAlarmsLocked: head of list: 249447659 nowELAPSED: 249447659 will sending alarm Batch size=1
03-12 16:01:38.813 745-1031/? V/AlarmManager: isAlarmNeedAlign : charging
03-12 16:01:38.813 745-1031/? I/AlarmManager: isRepeatingAlarmAllowed() in
03-12 16:01:38.813 745-1031/? I/AlarmManager: pkg : com.domobile.applock mWakefulness=false mIsPowerConnected=true
03-12 16:01:38.814 745-1031/? D/AlarmManager: set alarm to RTC 249626659
03-12 16:01:38.814 745-1031/? W/AlarmManager: triggerAlarmsLocked: head of list: 249447989 nowELAPSED: 249447659 =&gt; not fire alarm in the future
03-12 16:01:38.814 745-1031/? V/AlarmManager: Triggering alarm #0: Alarm{f1d35bb type 3 when 249447659 com.domobile.applock}
03-12 16:01:38.814 745-1031/? V/AlarmManager: sending alarm Alarm{3173824a type 3 when 249446659 com.domobile.applock} , intent = Intent { cmp=com.domobile.applock/.service.LockService }
03-12 16:01:38.815 745-1031/? I/ActivityManager: [Background Service Priority Adjustment] Set callerFg as false for service.getFlags():260
03-12 16:01:38.816 1806-1806/? D/ActivityThread: SVC-Calling onStartCommand: com.domobile.applock.service.LockService@1fe00534, flags=0, startId=51247
03-12 16:01:38.817 1806-1806/? D/ActivityThread: SVC-SERVICE_ARGS handled : 0 / ServiceArgsData{token=android.os.BinderProxy@160d4646 startId=51247 args=Intent { flg=0x104 cmp=com.domobile.applock/.service.LockService (has extras) }}
03-12 16:01:38.817 745-745/? D/AlarmManager: onSendFinished begin
03-12 16:01:38.818 745-1031/? D/PowerManagerService: mDisplayPowerRequest.policy = 0
03-12 16:01:38.819 745-1031/? D/PowerManagerService: isWfdEnabled() mWfdStatus=WifiDisplayStatus{featureState=2, scanState=0, activeDisplayState=0, activeDisplay=null, displays=[], sessionInfo=WifiDisplaySessionInfo: C/O:Client,GId:,Pp:,SId:0,IP:}, return false
03-12 16:01:38.819 745-1031/? I/PowerManagerService: setBrightness mButtonLight 0.
03-12 16:01:38.819 745-1031/? D/PowerManagerNotifier: onWakeLockAcquired: flags=1, tag="*alarm*", packageName=android, ownerUid=1000, ownerPid=745, workSource=WorkSource{10124}
03-12 16:01:38.820 745-1031/? V/AlarmManager: sending alarm Alarm{f1d35bb type 3 when 249447659 com.domobile.applock} , intent = Intent { cmp=com.domobile.applock/.service.LockService }
03-12 16:01:38.820 745-1031/? I/ActivityManager: [Background Service Priority Adjustment] Set callerFg as false for service.getFlags():260
03-12 16:01:38.821 1806-1806/? D/ActivityThread: SVC-Calling onStartCommand: com.domobile.applock.service.LockService@1fe00534, flags=0, startId=51248
03-12 16:01:38.821 1806-1806/? D/ActivityThread: SVC-SERVICE_ARGS handled : 0 / ServiceArgsData{token=android.os.BinderProxy@160d4646 startId=51248 args=Intent { flg=0x104 cmp=com.domobile.applock/.service.LockService (has extras) }}
03-12 16:01:38.823 745-745/? I/AlarmManager: ResultReceiver =&gt; mBroadcastRefCount: 1
03-12 16:01:38.823 745-745/? D/AlarmManager: onSendFinished begin
03-12 16:01:38.823 745-745/? I/AlarmManager: ResultReceiver =&gt; mBroadcastRefCount: 0
03-12 16:01:38.824 745-745/? D/PowerManagerNotifier: onWakeLockReleased: flags=1, tag="*alarm*", packageName=android, ownerUid=1000, ownerPid=745, workSource=WorkSource{10124}
03-12 16:01:38.824 745-745/? D/PowerManagerService: mDisplayPowerRequest.policy = 0
03-12 16:01:38.824 745-745/? D/PowerManagerService: isWfdEnabled() mWfdStatus=WifiDisplayStatus{featureState=2, scanState=0, activeDisplayState=0, activeDisplay=null, displays=[], sessionInfo=WifiDisplaySessionInfo: C/O:Client,GId:,Pp:,SId:0,IP:}, return false
03-12 16:01:38.827 745-745/? I/PowerManagerService: setBrightness mButtonLight 0.
03-12 16:01:38.858 745-760/? I/BufferQueue: [unnamed-745-503](this:0x5595e4c670,id:503,api:1,p:-1,c:-1) ~BufferQueueCore
03-12 16:01:39.142 745-1031/? I/AlarmManager: triggerAlarmsLocked: head of list: 249447989 nowELAPSED: 249447989 will sending alarm Batch size=1
03-12 16:01:39.143 745-1031/? W/AlarmManager: triggerAlarmsLocked: head of list: 249448659 nowELAPSED: 249447989 =&gt; not fire alarm in the future
03-12 16:01:39.143 745-1031/? V/AlarmManager: Triggering alarm #0: Alarm{1f710ad8 type 2 when 249447989 com.android.systemui}
03-12 16:01:39.143 745-1031/? D/AlarmManager: set alarm to RTC 249453018
03-12 16:01:39.143 745-1031/? D/AlarmManager: set alarm to RTC 249448659
03-12 16:01:39.144 745-1031/? V/AlarmManager: sending alarm Alarm{1f710ad8 type 2 when 249447989 com.android.systemui} , intent = Intent { act=com.android.internal.policy.impl.PhoneWindowManager.DELAYED_KEYGUARD (has extras) }
03-12 16:01:39.144 745-1031/? D/AlarmManager: wakeup alarm = Alarm{1f710ad8 type 2 when 249447989 com.android.systemui}; package = com.android.systemui
03-12 16:01:39.144 745-1031/? V/ActivityManager: Broadcast: Intent { act=com.android.internal.policy.impl.PhoneWindowManager.DELAYED_KEYGUARD flg=0x114 (has extras) } ordered=true userid=0 callerApp=null
03-12 16:01:39.146 1167-1167/? I/lenovokeyguard.log: (1167.0/main/1.5)[KeyguardViewMediator]{mBroadcastReceiver.onReceive}&lt;context com.android.systemui.SystemUIApplication@18fda0a5&gt;&lt;intent #Intent;action=com.android.internal.policy.impl.PhoneWindowManager.DELAYED_KEYGUARD;launchFlags=0x114;i.seq=211;i.android.intent.extra.ALARM_COUNT=1;end&gt;
03-12 16:01:39.147 1167-1167/? I/lenovokeyguard.log: (1167.0/main/1.5)[KeyguardViewMediator]{doKeyguardLocked}&lt;options null&gt;
03-12 16:01:39.148 1167-1167/? V/SettingsInterface:  from settings cache , name = auto_switch_to_openzone , value = null
03-12 16:01:39.149 745-1031/? D/PowerManagerService: mDisplayPowerRequest.policy = 0
03-12 16:01:39.149 745-1031/? D/PowerManagerService: isWfdEnabled() mWfdStatus=WifiDisplayStatus{featureState=2, scanState=0, activeDisplayState=0, activeDisplay=null, displays=[], sessionInfo=WifiDisplaySessionInfo: C/O:Client,GId:,Pp:,SId:0,IP:}, return false
03-12 16:01:39.149 745-1031/? I/PowerManagerService: setBrightness mButtonLight 0.
03-12 16:01:39.150 745-1031/? D/PowerManagerNotifier: onWakeLockAcquired: flags=1, tag="*alarm*", packageName=android, ownerUid=1000, ownerPid=745, workSource=WorkSource{10029}
03-12 16:01:39.150 745-1031/? I/AlarmManager: updateStatsLocked() in
03-12 16:01:39.151 745-1125/? D/PowerManagerService: mDisplayPowerRequest.policy = 0
03-12 16:01:39.152 745-1125/? D/PowerManagerService: isWfdEnabled() mWfdStatus=WifiDisplayStatus{featureState=2, scanState=0, activeDisplayState=0, activeDisplay=null, displays=[], sessionInfo=WifiDisplaySessionInfo: C/O:Client,GId:,Pp:,SId:0,IP:}, return false
03-12 16:01:39.152 745-1125/? I/PowerManagerService: setBrightness mButtonLight 0.
03-12 16:01:39.152 745-1125/? D/PowerManagerNotifier: onWakeLockAcquired: flags=1, tag="show keyguard", packageName=com.android.systemui, ownerUid=10029, ownerPid=1167, workSource=null
03-12 16:01:39.153 1167-1167/? D/ActivityThread: BDC-Calling finishReceiver: IIntentReceiver=b4c59ef
03-12 16:01:39.153 745-1031/? I/AlarmManager: mAlarmStats.size():21
03-12 16:01:39.153 745-1031/? I/AlarmManager: updateStatsLocked() out
03-12 16:01:39.153 745-1031/? I/AlarmManager: com.android.systemui Wakeup System : 105 times
</code></pre>

<hr>

<p>My MapActivity.java</p>

<hr>

<pre><code>    package com.example.dell_pc.mymapapp;

import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

public class MapsActivity extends FragmentActivity {
    Context context;
    LocationManager locationManager;

    private GoogleMap mMap; // Might be null if Google Play services APK is not available.

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_maps);
        setUpMapIfNeeded();

         context = this;

        locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
    }

    @Override
    protected void onResume() {
        super.onResume();
        setUpMapIfNeeded();
    }


    private void setUpMapIfNeeded() {
        // Do a null check to confirm that we have not already instantiated the map.
        if (mMap == null) {
            // Try to obtain the map from the SupportMapFragment.
            mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
                    .getMap();
            // Check if we were successful in obtaining the map.
            if (mMap != null) {
                setUpMap();
            }
        }
    }

    /**
     * This is where we can add markers or lines, add listeners or move the camera. In this case, we
     * just add a marker near Africa.
     * &lt;p/&gt;
     * This should only be called once and when we are sure that {@link #mMap} is not null.
     */
    private void setUpMap() {
        mMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title("Marker").snippet("Snippet"));

        // Enable MyLocation Layer of Google Map
        try {
            mMap.setMyLocationEnabled(true);
        } catch (SecurityException e) {
            Log.e("PERMISSION_EXCEPTION", "PERMISSION_NOT_GRANTED");
        }


        // Get LocationManager object from System Service LOCATION_SERVICE
        LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);

        // Create a criteria object to retrieve provider
        Criteria criteria = new Criteria();

        // Get the name of the best provider
        String provider = locationManager.getBestProvider(criteria, true);

        // Get Current Location


        Location myLocation = null;
        try {
            myLocation = locationManager.getLastKnownLocation(provider);
        } catch (SecurityException e) {
            Log.e("PERMISSION_EXCEPTION", "PERMISSION_NOT_GRANTED");
        }

        if (myLocation != null) {
            Log.v("Location_", "Got Old location");
            double latitude = myLocation.getLatitude();
            double longitude = myLocation.getLongitude();
        } else {
            Log.v("Location_", "NO Last Location found");
            // No last location! request for location update
            MyLocationListener locationListener = new MyLocationListener();
            if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &amp;&amp; ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
                // TODO: Consider calling
                //    ActivityCompat#requestPermissions
                // here to request the missing permissions, and then overriding
                //   public void onRequestPermissionsResult(int requestCode, String[] permissions,
                //                                          int[] grantResults)
                // to handle the case where the user grants the permission. See the documentation
                // for ActivityCompat#requestPermissions for more details.
                return;
            }
            locationManager.requestLocationUpdates(provider, 0, 0, locationListener);
        }


        // set map type
        mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);

        // Get latitude of the current location
        double latitude = myLocation.getLatitude();


        // Get longitude of the current location
        double longitude = myLocation.getLongitude();

        // Create a LatLng object for the current location
        LatLng latLng = new LatLng(latitude, longitude);

        // Show the current location in Google Map
        mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));

        // Zoom in the Google Map
        mMap.animateCamera(CameraUpdateFactory.zoomTo(14));
        mMap.addMarker(new MarkerOptions().position(new LatLng(latitude, longitude)).title("You are here!").snippet("Consider yourself located"));
    }


    private class MyLocationListener implements LocationListener {

        public void onLocationChanged(Location location) {

           // double latitude = location.getLatitude();
           // double longitude = location.getLongitude();

            Toast.makeText(context, "Location Changed&gt;&gt;", Toast.LENGTH_LONG).show();
            //handleNewLocation(location);

// below line showing warning Call require permission which may be rejected by User
            locationManager.removeUpdates(this);
        }

        public void onStatusChanged(String s, int i, Bundle bundle) {
            Log.v("Location_", "Status changed: " + s);
        }

        public void onProviderEnabled(String s) {
            Log.e("Location_", "PROVIDER DISABLED: " + s);
        }

        public void onProviderDisabled(String s) {
            Log.e("Location_", "PROVIDER DISABLED: " + s);
        }
    }
}
</code></pre>

<hr>

<p>Please Help!!
Thanks in advance!!</p>