ViewModel observe is running multiple times for a single hit to API

I have a Chart in fragment and a switch. On switch selection the API needs to be hit again with a new value and chart needs to be updated, the API code is as shown: private fun hitSecondChartApi(country: String, category: String, market: String, weightKpi: String) { userModel.getResponseShareSecondChartData(country, category, market, weightKpi) Log.e(TAG, “Inside hitsecondchartapi: “+ country+”:”+category+”:”+market+”:”+weightKpi)…

Details