Category "java"

How to call an activity method from a fragment?

I need to call a method that is in an activity from a fragment , i can't even instatiate the activity in the fragment , I don't know how to approach this proble

How to call an activity method from a fragment?

I need to call a method that is in an activity from a fragment , i can't even instatiate the activity in the fragment , I don't know how to approach this proble

How to detect what the content on the display is?

I have an app that rotates other apps. It uses an accessibility service so I have the ability to retrieve screen content. Say I'm rotating a game called Geometr

Eclipse freezes while showing hover suggestions like method suggestions in class, method info etc

When I enter a dot operator after entering the class name, Eclipse will show method suggestions auto complete, at that time Eclipse hangs and gets closed automa

httpclient5 jdk8(1.8.0_292) CloseableHttpAsyncClient Received fatal alert: protocol_version but CloseableHttpClient works well

httpclient5 async code: HttpContext httpContext = new BasicHttpContext(); BasicCookieStore cookie = new BasicCookieStore(); httpContext.setAttribute(HttpClientC

How to stop listening in a Spring Kafka consumer?

I use Spring for Apache Kafka. I'd like to stop listening to my topic and wait to escape OOM. How can I do it?

How to update few fields in JSON file and again read the JSON with updated values in selenium using Java

How to update few fields in JSON file and again read the JSON with updated values in selenium using Java. Below is my JSON : I want to update { "DemoFileJson

How to resolve: antlr.CommonToken cannot be cast to antlr.Token?

I have just finished an update from wildfly 9 to 23 and am now re-working my arquillian implementation to work with the new application server version. Dependen

Hadoop Streaming Job showing error /bin/java : No such file or directory

I have installed Hadoop in my Macbook M1 2020 with MacOS Monterey 12.3.1. I am able to successfully use hadoop and hdfs commands in my Laptop. I started using h

Logback-classic 1.2.8 DBAppender Missing

I'm trying to upgrade the logback-classic library from version 1.2.3 to 1.2.8. The patch notes say that all DB related code has been removed, so the main DBAppe

High CPU usage when shifting from Java 8 to Java 11 with G1GC

We are having following VM settings for our server. This configuration works perfectly when running Java 8. But when we switch JVM to Java 11 OpenJDK, the serve

Pass VM Argument in IntelliJ

My main() method that creates instances of my Game Class and GUI class (implementing a board game) and passes that to a new Thread: new Thread(new Game(gui, ar

Atom linter doesn't recognize classes in the same package

I currently have the linter package (here: apm install linter) and the linter-javac package (here: apm install linter-javac). It works great for the most part,

Error inflating class com.google.android.material.button.MaterialButton

What i'm trying to achieve is having a gridview with some materialButton inside. I tried to create the gridview like : <GridView android:id="@+id

NullPointerException when upgrading Spring Boot to version 2.6.2

I upgraded by Spring Boot version from 2.5.4 to 2.6.2. Now my app fails at startup because of this error - see below. Any ideas how to fix it? Error starting Ap

Android Studio media player doesnt play when the app is closed

I made an Android app that should play a sound when event is received, it works when app is in focus, but when the app is closed/collapsed sound doesnt play, on

How to sort array in constant time in java and python?

I was trying to learn algos and data structures, and i was wondering about best approach to sort arrays in constant time. I am newbie but my only intention is t

Excluding complete modules from jacoco coverage

I have a multi-module project like lets say below: Project |-- DataModule |-- LogicModule |-- ServiceClientModule In this project the service client will just

How can i remove a title screen element with fabric in Minecraft 1.18.1

I am currently able to add elements to the title screen: public abstract class MCEMixin extends Screen { protected MCEMixin(Text title) { super(tit

Spring Reactor onErrorContinue not working

As per documentation I am expecting onErrorContinue will ignore the error element and continue the sequence. Below test case is failing with exception java.lan