Skip to content

Tag: java

Android Activity without ActionBar

I have different Activities in my App and in all of them I do not want the Action Bar. I cannot find how to disable it. I have tried to find an attribute to apply it to the main_activity.xml but so far I did not find anything. Can somebody help me please? Answer Haha, I have been stuck at that

Finding date of birth from age in java

Hello all I am creating a program for finding the date of birth when the exact age is given. For example if age of a man is 21 years 10 months and 22 days(up to current date) how can i find the exact date of birth. I will be thankful if anyone help me with isuue. What i tried is

How to map a map JSON column to Java Object with JPA

We have a big table with a lot of columns. After we moved to MySQL Cluster, the table cannot be created because of: ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 14000. This includes storage overhead, check the manual. You have to change some colu…

How to load image from URL in Fragment class?

I want to load an image from its URL in Fragment class. I’m loading the image like this: but this method is taking more time to load the image and to open it. If I want to use ImageLoader class like this tutorial, then how to load it in Fragment? Answer Use any 3rd party library like Picasso. Download t…

Are non-static final variables useful in Java?

This question discusses the practices of non-static final variables. My first impression is that non-static final variables are useless because final variables cannot be reassigned after initialization. That would mean all the objects created from type Foo would have BAR = 10. When would it be useful, practic…

How to make pattern of numbers in java using only two variables?

this is the required pattern and the code which i used is as you can see i used the variable k to print the numbers. My question is that is there a way to print the exact same pattern without using the third variable k? I want to print the pattern using only i and j. Answer Since this problem

String.valueOf(Integer) always return 1

I’m trying to parse String “2 2 2” and add every symbol ‘2’ in ArrayList. This is my code: I can’t understand why System.out.println(String.valueOf(myIntArray.get(rawSize)));always return 1 ? UPDDATE: I try read file, which contain next text: Here is my Main function: publi…