Actually I'm working on a weather forecast app and I'm getting a null pointer exception when I'm trying to get the user last known location

private ProgressBar loadingPb; private TextView cityNameTV ,conditionTV, temperatureTV; private TextInputEditText cityEdt; private RecyclerView weatherRV; private ImageView backIV , iconIV , searchIV; private ArrayList<WeatherRVmodel> weatherRVmodels; private WeatherRVAdapter weatherRVAdapter; private LocationManager locationManager; private int PERMISSION_CODE = 1; private String cityName; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); homeRL = findViewById(R.id.idRLHome); loadingPb = findViewById(R.id.idPBLoading); cityNameTV =… Read More Actually I'm working on a weather forecast app and I'm getting a null pointer exception when I'm trying to get the user last known location