Discussion on:

5
Comments

Join the conversation!

Follow via:
RSS
Email Alert
0 Votes
+ -
a small correction
bart001fr Updated - 5th Jan 2012
Your splash screen should read "...Calendar" in the first line below the blue separation line.

I located the error in the third paragraph of code listed above; in "main.xml" locate the line which is the offending line, as you can see. Please correct it. Thank you.

Little things like that are important and say a lot about a programmer. Like how much he cares about the accuracy of his programs.
0 Votes
+ -
Contributr
@bart001fr
authorwjf 5th Jan 2012
Good catch! Will update it ASAP.
0 Votes
+ -
While I agree it doesn't work properly on an emulator, I did find it difficult to even compile & build at first. What you might want to mention is to make sure all your Android SDKs (especially the 4.0 and above versions) are up to date. I had an early version of the 4.0 build, and as such the compiler wouldn't recognize R.layout.main , R.id.next , and R.id.previous as valid values. When I installed the updates to 4.0 and 4.0.3. it would recognized them. Note the current update for 4.0 is missing a kernal file, but 4.0.3 works (API 15).
You have your class as Main, yet when I try to run this way, the program just crashes with Class Not Found: com.authorwjf.calsample.CalendarContractActivity
This can be easily fixed simply my renaming the class as CalendarContractActivity (as well as the java file name). Again this just makes it runnable. The Prev and Next button will do nothing and the date will stay in January of 1969, probably due to reasons you mentioned in your article.
You also have the @Override annotation for the <nClick(View v) routine. Eclipse says not to as you only add it when you are overriding a superclass method. So just remove the annotation for the routine.
Also running it the first time may result in failure. If this happens, just close the emulator and try running it again. Something about initial setup I think is causing the install to fail.
0 Votes
+ -
Contributr
@btmaster1
authorwjf 6th Jan 2012
Thanks for the updates. I wasn't aware that earlier builds of the Android 4.0 SDK might give users problems so I appreciate you sharing that experience.
0 Votes
+ -
Great
leomat1988 31st Jul
Thanks! Very Interesting!
It would be great to also have an example of writing in the calendar.
Keyboard Shortcuts:
Prev
Next
Toggle
Join the conversation
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.