| | |
| | | import com.dayu.pipirrapp.R; |
| | | import com.dayu.pipirrapp.activity.MainActivity; |
| | | import com.dayu.pipirrapp.bean.db.LatLonBean; |
| | | import com.dayu.pipirrapp.utils.CommonKeyName; |
| | | import com.dayu.pipirrapp.utils.MyLog; |
| | | import com.dayu.pipirrapp.utils.ToastUtil; |
| | | import com.jeremyliao.liveeventbus.LiveEventBus; |
| | |
| | | PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_IMMUTABLE); |
| | | |
| | | Notification notification = new NotificationCompat.Builder(this, "location_channel") |
| | | .setContentTitle("定位服务") |
| | | .setContentText("定位服务正在后台运行") |
| | | .setContentTitle("巡检定位") |
| | | .setContentText("巡检定位服务正在后台运行") |
| | | .setSmallIcon(R.mipmap.ic_launcher) |
| | | .setContentIntent(pendingIntent) |
| | | .build(); |
| | |
| | | LatLonBean latLonBean = new LatLonBean(); |
| | | latLonBean.setLatitude(latitude); |
| | | latLonBean.setLongitude(longitude); |
| | | LiveEventBus.get("location").post(latLonBean); |
| | | LiveEventBus.get(CommonKeyName.locationData).post(latLonBean); |
| | | } |
| | | |
| | | |