DialogFragment/AlertDialog dismiss automatically on click button

I was dealing with the case of use an EditText inside my AlertDialog that is created inside an DialogFragment last week and I remembered that I could write a tip about some problems of it. What problems?  It's simple...An EditText...inside an AlertDialog...Ok, but how to avoid the dismiss of the Dialog when the user click in … Continue lendo DialogFragment/AlertDialog dismiss automatically on click button

Message.obtain() and new Message() – TIP

Is not possible send the same Message instance several time, only once. So we always have to create a new instance. Better than that, instead of create a new instance (new Message()), we can use the method obtain (Message.obtain()) that will return a recycled instance of Message from the pool of recycled objects, what is … Continue lendo Message.obtain() and new Message() – TIP

Service restart behavior – Compilation

START_STICKY Service is restarted if it gets terminated. It will tell the system to create a newest copy of the service, when available memory is sufficient to do, after it retains state and recovers from the low memory. In this process we will loose the results that might have calculated before. onStartCommand() will be called on the … Continue lendo Service restart behavior – Compilation

Hibernate JPA 2.1 – StoredProcedureQuery

Thanks to... someone... that we have JPA 2.1 and the feature StoredProcedureQuery. Throught this method we can call easily a procedure in our database, set parameters and convert the possible result into Java object automatically. Let's imagine a simple procedure called 'SALES_ACCOUNTING' that receives two dates ('INITIALDATE' and 'FINALDATE') that determine the time period and … Continue lendo Hibernate JPA 2.1 – StoredProcedureQuery