Skip to content
Advertisement

Tag: java

Jackson deserialization to concrete polymorphic class

I have following Jackson annotated classes (Kotlin) I try to deserialize JSON that does not contain type property but I provide concrete class so it should not matter I get Missing type id when trying to resolve subtype of … anyway. Is there a way how to tell Jackson to use the type provided in the deserialization and not to

Rendering same video to 2 Surfaces from a MediaCodec

MediaCodec has 2 ways of operating: you either pass a Surface for it to render to, or you read the output buffer and paint it to the screen yourself. In the first case, where I pass a surface: is it possible to paint the same MediaCodec decoded video to 2 surfaces? The decoding loop looks something like this: Answer The

JAVA Method returns unexpected value

I am a very new java programmer, the below code is my first attempt at my own project. I’m certain the code is a mess, please forgive me. In the below code the user is prompted to enter 5 values between 1 and 50. I am placing the input values into an int[]. I want to verify that the numbers

import android.support.v4.app.ActivityCompat;

This is the error i am seeing when i add “simple_permissions” package. How can i fix this? I recently upgraded flutter and it used to work very well before the upgrade. /root/flutter/.pub-cache/hosted/pub.dartlang.org/simple_permissions-0.1.9/android/src/main/java/com/ethras/simplepermissions/SimplePermissionsPlugin.java:9: error: cannot find symbol import android.support.v4.app.ActivityCompat; Answer I suggest you to check the package before using it. It seems that simple_permissions is outdated and this package hasn’t been

Error in Debug caused by creation of beans

I state that I am new on the forum and I am a beginner with Java, so I apologize in advance for any mistakes. I’m working on a web application in Java, using Spring Boot, to utilize Google Drive API for list files on my Google Drive. I’m follow the courses on youtube from carbonrider, so the main and the

Referencing packages in java without using String

Is there a way to reference a package in java in code without using a String? Let me explain myself: I’ve a function that fetches all object contained in a package, but I’ve to reference that package using a String, lets say “com.google.guava”. This works, however, If I change the package name, the IDE is not able to automatically refractor

Throwing own exceptions

I have this class Account Now I also have this exception that I wrote Now I need to throw this exception in the class account,when the searched account number does not exist.Now my question is in which method(or function I think that is the same,please correct me if I’m wrong) do I throw this exception.And after what check.How would I

Advertisement