Questions tagged as 'java'

2
answers

Error in array indexes

Because the index i of the first for reaches i>0 and because the index i of the main class reaches i>=0 ? because if I put in the first for i>=0 I get an error when executing. public String[] i...
asked by 10.06.2017 / 04:47
3
answers

Cancel AsyncTask and the ProgressDialog when pressing back button on Android

I have a AsyncTask that launches a ProgressDialog in modal form, that can not be canceled. In the onPreExecute start the progressDialog progress = ProgressDialog.show(MainActivity.this, "titulo","progreso x", tru...
asked by 31.05.2017 / 22:04
2
answers

Add minutes to current date to get date in format YYYY-MM-DD HH: MM: SS

Good morning, I can not find a way to add minutes to the current date and give me a new date. For example if you add 48 hours you would have to change the day too, but the code I have does not. I am working with the following: java.util.Dat...
asked by 22.05.2017 / 13:21
3
answers

What is and what is the @PostConstruct in java beans?

In a project / code I'm encountering this @PostConstruct tag and I do not really understand what works? Someone can explain to me what their function or purpose is. I would appreciate it very much.     
asked by 05.06.2017 / 19:17
2
answers

Check in which Activity I am

I have this Button in my Adapter of RecyclerView and when I click on it you should update my RecyclerView with the method ActualizarRecyclerView holder.delete_nota.setOnClickListener(new View.OnClickListe...
asked by 25.06.2017 / 14:35
6
answers

copy files from one folder to another

I have the following program: public static void main(String args[]) { File origen = new File("C:\Users\Montse\Documents\NetBeansProjects\Copiar2\hola.txt"); File destino = new File("C:\Users\Montse\Documents\...
asked by 27.02.2017 / 19:01
2
answers

Work with the results obtained from a query to BBDD from java

Good morning, I can not find the way to work with the results returned by a query to Database from java. The code where I made the query is the following: boolean isInsert; try (PreparedStatement ps = con_actu.prepareStatement("SELECT *...
asked by 07.05.2017 / 21:45
1
answer

Error getting SharedPreferences

I'm trying to create a class to get the predefined data, but when I call the method Load() the app stops. Could you help me? Thanks package com.example.nano.prueba.login.loginprueba; import android.content.Context; import android.conte...
asked by 03.04.2016 / 01:40
2
answers

NullPointerException - exception handling

I had the following error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException This error is generated when generating a PDF file that is already open, if it is closed it creates it but if it is open it jumps that exceptio...
asked by 17.01.2017 / 20:01
2
answers

Error control, it generates infinite loop

I am starting to use try-catch . In this example I ask for a number and if the user enters a number it is displayed, if he writes any letter the error jumps. My intention was that when I entered a letter I would miss the message of "...
asked by 18.01.2017 / 12:52