Skip to content

Tag: java

Android Fatal Signal 11

In the app I’m developing on Android, I keep getting a Fatal Signal 11 error. I think it’s something to do with the way that I’m accessing the memory but I can’t figure out what is causing it. Here’s the LogCat: Answer I had been trying to call an uninitialised Canvas inside anot…

Draw a scaled Bitmap to the Canvas?

The following code defines my Bitmap: … And the following code is used to execute/draw it (the unscaled Bitmap): My question is, how might I set it to draw the scaled Bitmap returned in the form of Bitmap scaled, and not the original? Answer Define a new class member variable: Bitmap mScaledBackground; …

3-Dimension List or Map

I need something like a 3-dimension (like a list or a map), which I fill with 2 Strings and an Integer within a loop. But, unfortunately I don’t know which data structure to use and how. Answer Create an object that encapsulates the three together and add them to an array or List: If you want to insert …

java import “cannot find symbol”

I’m about porting a linux tool to windows. The tool works fine on linux system, but now on windows I get this “cannot find symbol” error. I have this little main class: and the error appears now, while doing javac Main.java: import foo.bar: cannot find symbol ^ symbol: class bar location: pa…

javax.management.AttributeNotFoundException

I am at Camel 2.9.0. I am able to view the MBean data(routes, processors, etc) for running processes in JConsole. I need to display the same in our user interface. While I try to fetch the attribute values, I get the following error. Note – Attribute “EndpointUri” is fetching the right value…

How to use null in switch

In the code above I can’t use null in the switch case statement. How can I do this differently? I can’t use default because then I want to do something else. Answer This is was not possible with a switch statement in Java until Java 18. You had to check for null before the switch. But now, with pa…