Skip to content
Advertisement

Tag: java

Unable to load a groovy classes

I am trying to serialize and deserialize a groovy object with the below class in the jenkins pipeline. SerializationUtil.groovy Test.groovy Jenkins pipeline script I was able to serialize the object but not deserialize. I am getting the below exception. From the exception, I could see that GroovyClassLoader is not called and I assume that might be the issue. Answer The

Using Intent.createChooser and getting error: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag

I want to open the share via option from the service class. It is working fine in Android 7, but in 8+ OS it starts showing android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? I have also included this flag to my Intent, but it’s still showing the same

Google Nearby Messages API: Attempting to perform a high-power operation from a non-Activity Context

Calling subscribe on the Google Nearby Messages API for Android results in the Exception: My code: Note: The promise Parameter is from React Native, I’m trying to create a wrapper for the API. At the Log.d event inside my OnCompleteListener, it prints: I do have the API Key and the required Permissions (BLUETOOTH, BLUETOOTH_ADMIN) in my AndroidManifest.xml. On iOS the

buildSrc: Could not get unknown property for object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler

I am trying to reorganize this Android (Java based) library to use the buildSrc folder to define all versions and dependencies as described in this article. I already set this successfully up for several times for Kotlin bases projects. This time the project is pure Java. In the buildSrc folder I created the following buildSrc/src/main/java/org/ligi/snackengage/Dependencies.java file: Then I refer to

Sum int values in unsorted ArrayList based on dates

I’ve got a list of objects with LocalDateTime and int fields. Here is an example of an object from the list: How to check whether a sum of ints on a certain date (multiple entries for the same date possible) does not exceed some value for O(n) or better? forEach loop must be used, sorting is restricted. Answer I’ve done

Advertisement