ViewModel observe is triggered more than twice while the API is hitting only once

The viewmodel observe is triggering up many times(3-4) in a row for the same event in both fragment and activity. Here’s the viewmodel code: userModel.getResponseSuperRegion(countryID) userModel.responseSuperRegion.observe(this, Observer { if(it!=null) { Log.e(TAG,”Observer ran!!!!”) Utils.debugger(“FRAG “, “$it”) requestResults(countryID, date, spec, it!!.get(0).nameValue, businessUnit) }else{ Toast.makeText(applicationContext, “Data Not Available!”, Toast.LENGTH_LONG).show() dismissProgress() } }) the same type of code i…

Details

Slow Execution for Copying Data from One Sheet to Another Using Google App Script

I would like your help in speeding up this script please. I got the script from an answer from Stack overflow. It is taking longer than it should (30-50 seconds), although previously it didn’t. function FormExec() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sinput = ss.getSheetByName(“Slip”); var rng1 = sinput.getRange(“B3”).getValue(); var rng2 = sinput.getRange(“D3”).getValue(); var rng3…

Details

Getting Error like “java.lang.UnsupportedOperationException: Section 4.4 of the Servlet 3.0 specification does not permit this method to be called”

I am migrating Spring XML based configuration to Java based configuration. The below class which implements HttpSessionListener and ApplicationContextAware was working fine with XML configuration. But with Java configuration, getting below error while starting the Tomcat server. Error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sessionListener’ defined in com.grc.config.WebConfig: Initialization of bean failed; nested exception is…

Details

Mongo – Java – get all documents sort string date as date

Just wondering what the best approach is. The following code needs to be able to sort a string date as a date value in descending order, but with pagination. documentList = collection.find().skip(skip).limit(limit).sort(Sorts.descending(“ReceivedDate”)); Aside from the sort not working the rest of the line works a treat. Im still getting used to using Mongo. thought it…

Details