Posts

Setup & configure IDE for Grails

Mar 26 2019 : Eclipse latest version is not working with grails                        Intellij Community Edition don't suppost grails                        Best option Intellij Ultimate Edition , but not free -> install "eclipse-jee-luna" -> install "Grails Tool Suite" plugins -> download "Windows installer" 2.5.6 & install from https://groovy.apache.org/download.html setup environment variable check in command line : groovy -v & groovyconsole

How to solve Android Studio rendering problem

Image
Android Studio can't render. After adding components I can't see anything in the screen. here's what i get : I have the following Error on the screen: It says: Render Problem :  Failed to load AppCompat ActionBar with unknown error. if you get issue like this please check out solution below, hope that will solve your problem. SOLUTION: Go to >> build.gradle(Module: app) :  DELETE  >> implementation 'com.android.support:appcompat-v7:28.0.0-rc02' ADD >> implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'  [now it's not working, see the solution below this page] Then >> Sync now Just after 3 weeks get the same issue New Solution :    this time i change the following things, now it's working. Go to >> build.gradle(Module: app) :  replace  'com.android.support:appcompat-v7:28.0.0-alpha1' /  com.android.support:appcompat-v7:28.0.0-rc02  with  implem...

On focus out Keyboard hiding issue : after hiding keyBoard when I click in EditText it crashed

I am working on to hide keyboard when click out side the EditText. At first I set OnTouch listender & Click listener out site EditText elements. When those elements touched I am calling a custom method ( hideKeyBoard() show below ). private void hideKeyBoard() { InputMethodManager imm = (InputMethodManager) getSystemService( INPUT_METHOD_SERVICE ); imm.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0 ); } and additionally I have to add those competent few attribute like android :clickable= "true" android :focusable= "true" android :focusableInTouchMode= "true" to make those elements clickable & focusable. keyBoard was hiding & when I click EditText again I get error : Caused by:  java . lang . NullPointerException : Attempt  to  invoke virtual method  ' android . os . IBinder android . view . View . getWindowToken()'  on a  null object reference solution : after implementing th...

Android Date picker dialog setMinDate(long) and setMaxDate(long) issue

My objective was enable date with in certain range & disable the rest for date , so that user can't select those dates. I find these two method for date picker to set the minimum & maximum range. so first I able to disable all future dates with : d.getDatePicker().setMaxDate(System.currentTimeMillis()); this was working fine. Than I disable all dates before two weeks ago with this code : d.getDatePicker().setMaxDate(System.currentTimeMillis() - (2*7*24*60*60*1000)); it was working fine. here 2 for weeks, 7 for days, 24 for hour, 60 for minutes, 60 for seconds & 1000 for millisecond. so from last two weeks to current date my code was like this d.getDatePicker().setMaxDate(System.currentTimeMillis() - (2*7*24*60*60*1000)); d.getDatePicker().setMaxDate(System.currentTimeMillis()); The problem was when i desire to set range earlier this month. this process was not working. As an example i was planning to set date range between 42 weeks to 9 weeks early. t...

how to hide Fragment element from another fragment in Android - issue android

I wanted to hide component of a Fragment from another Fragment. I am using ViewPager for  Fragments. previously I transfer data from one Fragment to another Fragment, that time I before FragmentTransaction replace I added Bundle to ListDetailsFragment. so that was pretty easy stuff. i use FrameLayout Fragments. And it this case ViewPager is in place. I was able to pass data to Activity with interface, but unable to update date as fragment is already created. looking Fragment life cycle I was hopeful that onStart() will help me to update data when that particular Fragment is displayed. But I was wrong due to ViewPager  in place. than I have my answer in https://stackoverflow.com/questions/18375288/fragment-lifecycle-which-method-is-called-upon-show-hide. Here is the solution code I am come out with. [Objective selecting Hide / Show radio button in  FragmentOne, I will  Hide / Show text in  FragmentTwo ] .............................

How to calculate total number days difference between to dates in Android - java, Android

I am looking for a suitable solution to calculate number of days given two given dates: I am working a Andriod app. After go through stackoverflow.com pages I found  julien  solution very effective : https://stackoverflow.com/questions/20165564/calculating-days-between-two-dates-with-in-java Most for other links are just measuring dates different within a month. when to count days within couple of month those are not working attest don't meet my demand. So her i found  org . joda . time library for    Java. than looking for what available for Android & get this  'joda-time:joda-time:2.9.9'  So, I add this to app gradle Sync . there the code wich is implemented in an editText field for comparing it exceed certain date or not . package android.exapmple.com.mydateset; import android.app.DatePickerDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.DatePicker; import...

java.io.IOException: java.lang.ClassNotFoundException: org.springframework.web.SpringServletContainerInitializer - issue

Image
Jul 22, 2017 3:46:24 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.8.0_131\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.8.0_131/bin/server;C:/Program Files/Java/jre1.8.0_131/bin;C:/Program Files/Java/jre1.8.0_131/lib/amd64;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\Users\jAVA USER\AppData\Local\Microsoft\WindowsApps;;D:\eclipse-mars;;. Jul 22, 2017 3:46:24 PM org.apache.tomcat.util.digester.SetPropertiesRule begin WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Spring-Tutorial-7' did not find a matching property. Jul 22, 2017 3:46:24 PM org.a...