Questions tagged as 'java'

2
answers

What is the difference between return "view" and return "redirect: view" in a POST method for Spring MVC?

What happens is that I have a jsp view from which I fill a form, I send the data by means of the POST method to my controller and once the instructions are finished I return to the main view of my site. However, the methods contained in my dri...
asked by 24.02.2016 / 18:49
2
answers

Menu Color Hamburger NavigationView Android

Currently my menu looks black like the following image And I would like it to be white, my xml is the following: <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://s...
asked by 20.02.2018 / 14:59
2
answers

How to get a random number in a range?

I was wondering how you could get a random number in java within a range. The number must be a decimal number that is in a certain range, but random. private Random random = new Random(); random.setSeed((long) (centralPoint.x*456 + centralPoi...
asked by 09.02.2018 / 20:13
3
answers

Spinner with steps (values) of 0.5 in 0.5?

I need values that go as follows: 0.5 1 1.5 2 2.5 3 Etc I did a function but I do not know if it can be done in another way that requires less code, here's my code: private String GetNumber(int spinner) { String res...
asked by 03.01.2018 / 05:01
2
answers

Problem With Exceptions

Good guys, I told you my problem. I am practicing the subject of the exceptions in java and I have changed some of the validations that I have to replace them with exceptions but I have a problem and I do not know how to implement a second excep...
asked by 06.12.2017 / 20:09
1
answer

HDPI folders - MDPI - XHDPI etc

I would like to know what resolution my images should have for these different folders: The problem I have is that I only have 1 image that is 400px X 400px , so having a small screen for example, the images do not fit well and ar...
asked by 29.12.2017 / 13:33
1
answer

Full screen in WebView - Youtube?

The following code does its job perfectly: It takes me to YouTube using webview, that is, without leaving the application and the video plays perfectly. The problem is this: I can not rotate it to put it in full screen. I've tried with two mo...
asked by 26.01.2017 / 14:36
3
answers

Problem when casting variables in Java (Android): NumberFormatException: For input string: ""

I was starting with Android, but when doing something that in Java has never given me problems and launching it in an Android App, I have missed a lot of errors when executing it, because compiling does it without problems. The exercise I try...
asked by 09.10.2016 / 01:22
1
answer

Delete Row according to text in a Java Txt

Good I have a code like this: String ruta = "archivo.txt"; File archivo = new File(ruta); String texto; String[] a; String pre= "texto a encontrar"; FileReader f = new FileReader(archivo); FileWriter f1 = new FileWriter(archivo); Buffere...
asked by 11.05.2018 / 13:28
3
answers

Compare different ArrayList's in Java

Good evening I would like you to help me in the following: I have 2 ArrayList's: ArrayList<Persona> listaPersona; that its content transforming it into Json is the following: [{"nombre":"Luis", "edad":"22"},{"nombre":"Juan","edad...
asked by 03.05.2018 / 03:39