This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!

Ron McLeod

Saloon Keeper
+ Follow
since Feb 12, 2013
Ron likes ...
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
Richmond, BC, Canada
Cows and Likes
Cows
Total received
293
In last 30 days
3
Total given
122
Likes
Total received
601
Received in last 30 days
25
Total given
919
Given in last 30 days
46
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ron McLeod

Andrey Dmitriev wrote:


Have you verified that session is actually equal to null?
2 hours ago
Do you remove your shoes when entering your home?

Where I live (Canada) shoes are not normally worn inside the home or inside someone else's home when visiting.  When at home, some people have house shoes / slippers to wear - I just use socks.  Sometimes trades people that will be working in the house for longer periods where shoe booties over their shoes.

When I was living in Hong Kong and working in China, we removed shoes not only at home, but also when visiting businesses and factories.  At home, the shoes were often kept outside the main entrance (not inside the home).  For business visits, shoes were removed at the reception area, and visitor slippers were provided (anti-static slippers when visiting factories).


Image: http://www.momgoesgreen.com/simple-health-tip-remove-those-shoes/
16 hours ago

Rania Bradbury wrote:Nobody's using Java anymore, I almost believe it's the least favorite programming language ...



Its currently at the top on the the TIOBE Index


1 day ago

Ben Hutchenson wrote:Consistent naming convention: lowercase filename matches lowercase class's name


Class names (and associated file names) should use CamelCase and start with a capital letter ... Main.java rather than main.java.
2 days ago
Assuming that CountDownTimer is an anonymous class inside MainActivity, MainActivity.this would provide a reference to the application's context
2 days ago
What class are you calling the method from?

What you have posted is a method in the CountDownTimer class.  Is CountDownTimer an anonymous class inside MainActivity, or is it in its own class?
2 days ago

Ron McLeod wrote:... post the code for the class that you are calling it from.

2 days ago

Daniel Andersson wrote:Thanks but that did not work. I want to check if the phone is locked within a startTimer class


I understood you were calling this code from the MainActivity class.  If that is not the case, then post the code for the class that you are calling it from.
2 days ago

Daniel Andersson wrote:What should i write within the () ?


MainActivity extends Activity which eventually extends Context so you should be able to use this
== true is not needed
2 days ago

Daniel Andersson wrote:... I tried  this without success


Can you provide details on the what was unsuccessful?

Did you include a reference to the context?
2 days ago

Cl Castillo wrote:... the Javabean naming rules said "The method name must have a prefix of set/get/is, followed by the first letter of the property in uppercase, followed by the rest of the property name."

Property name is numberWings, so method name getNumWings should be wrong? Please clarify if I'm wrong.



According to The Java™ Tutorials: Glossary of Terms:
    property: Characteristics of an object that users can set, such as the color of a window.
    field: A data member of a class. Unless specified otherwise, a field is not static.

In this case:numWings is a property, and numberWings is a field.
In addition to Carey's comment, I would also suggest that you extract the validator code in to a separate method (maybe a separate class) which you can test and debug independently of the main application.

3 days ago
It says that the position is in Florida, USA.  I would assume that you need to be able to legally work in the USA to be considered.

Since his email address is included in the post, probably best to contact Sam White directly.
3 days ago
It would be this:
It would have been faster though just to try it yourself and see which one worked.
3 days ago
JSP