Skip to content

Why my IF can’t get some of my ArrayList’s indexes?

My idea here is to check whether the elements of my ArrayList start with A, B, C, or with another letter, but for some reason, my IF can’t get some words, such as “Almofada”. Output Answer Your issue is with your for loop. You are incrementing the index ‘i’ on each iteration of t…

SUM(ABOVE) functionality in apache poi or docx4j

I am trying to implement =SUM(ABOVE) function in docx which is used to sum all elements above to tht column. I was able to implement this with apache poi using : This is ok when someone opens the document and it calculates it. But if I need to convert the document without opening it to pdf then this function …

How can i extract ” ” “from json register in java

I’m working with a java’s library (Gson) to store new Users in a file named “users.json). When i register a new one, my code reads previous data in the file to convert and add with the new data in a List of Users to write the new content to the json file. The problem comes when the previous …

Can’t use FileObserver to Observe Files Inside a Folder

I want to observe if any file/folder is added inside /storage/emulated/0/DCIM/Camera using FileObserver in a service, but it didn’t work. Please tell me if there is anything wrong in my code 🙏. Here is the source code: AndroidManifest.xml I added the uses-permission and service tags: LogWatcherService.j…