Category "java"

Android 5.0 IllegalArgumentException: Service Intent must be explicit: on com.google.android.location.internal.GoogleLocationManagerService.START

I'm trying to retrieve the location of the device calling the method connect of the class LocationClient in my activity, however when the call is made the syste

How to get the maximum possible value obtained by deleting only one digit

I came across this codility test, in which I need to return the maximum possible value obtained by deleting one '5' digit from a number, for example: n = 15958

IntelliJ replace variable names in multiple lines

I am wondering is there a shortcut that can replace a variable name with a new name on multiple lines in the current Java file for IntelliJ. Is it just simply d

Can newer JRE versions run Java programs compiled with older JDK versions?

Would I encounter any problems running Java programs and associated libraries compiled in Java version 1.6 and 1.7 (I'm compiling using 1.7 whereas some librari

IntelliJ IDEA 2017.1 does not stop on breakpoints

I have an old Gradle project that I've opened recently using the new IDEA 2017 and I have just noticed it will not stop on breakpoints anymore (these are active

How to replace first occurrence of string in Java

I want to replace first occurrence of String in the following. String test = "see Comments, this is for some test, help us" **If test contains the input as

In JUnit 5, how to run code before all tests

The @BeforeAll annotation marks a method to run before all tests in a class. http://junit.org/junit5/docs/current/user-guide/#writing-tests-annotations But is

How can I get the previous Value of the TextView F12

How can I get the previous Value of the TextView F12? I want to put a Value in F12 and in a second Part, I want to add the previous Value with a new Value. fina

No suitable default RequestUpgradeStrategy found

I'm trying to use spring websocket for my application but when running the application on jetty i'm having an IllegalStateException. I found similar questions (

Pagination in JTable with row sorting

I have implemented pagination in JTable, in that there is row sorting as well. My problem comes when I click on the column header for sorting it sorts the curre

Can newer JRE versions run Java programs compiled with older JDK versions?

Would I encounter any problems running Java programs and associated libraries compiled in Java version 1.6 and 1.7 (I'm compiling using 1.7 whereas some librari

Graph exercise transitive closure

i have to find transitive closure of a given graph. So the method which craetes transitive closure should be working like this: G = ABCD --> G+ = AB AC AD BC

Both ENTER shortcut and TextArea in Vaadin

TextField f = new TextField(); Button b = new Button("Save"); b.setClickShortcut(KeyCode.ENTER); // For quick saving from text field itself TextArea longText =

String previous last index

Is there a simple way of getting the penultimate delimited substring of a string? String original = "/1/6/P_55/T_140"; In this example, the resulting substri

how to pass a java object to oracle stored procedure with following details

I have my ORACLE table with structure as desc extraction_log1 Name Null

Switching between screens in Java swing

I had build big application for my client in Android. The new project is to build the same app for PC in Java. So i have started developing with use of swing.

How can I check internet connection in Android Q?

Before Android Q all you had to do is use the NetworkUtils class. But this class was deprecated in API 29. I've been searching for an alternative, and I couldn'

Could not exec java with Spring+Maven exit code 1

I am new to Spring/Maven, and am following this tutorial: Serving Web Content with Spring MVC. Everytime I run mvn spring-boot:run, I get this error: Fail

Using RestFB along side a JavaFX WebView, how can I post to Facebook?

I've been trying a number of ways to achieve a way to post to Facebook from within my JavaFX application using a WebView to manage login. I have read Facebook's

How to avoid double-encoding of [] when using Spring RestTemplate?

I've a Spring Boot 2.2.5 application calling this REST endpoint @RequestMapping(path = "/usable/search") public List<Provider> findUsable( @Request