android-beginners  

Re: [android-beginners] using java classes

Niaz Habib
Thu, 18 Mar 2010 14:43:49 -0700

Android does like Java classes. Android is implemented in Java. Assuming you
have learned Java (or any other typed language), You just have to specify a
type when you declare a variable. So rewrite the line as:

Date date = new Date();

Also, make sure you import the class as

import java.util.Date;



On Wed, Mar 17, 2010 at 4:14 PM, Alex Hall <mehg...@gmail.com> wrote:

> Hi all,
> As an exercise, I am trying to add a date field to the database in
> notepadv2 (the tutorial), and methods to sort or reverse sort notes by
> date modified. However, I am not getting anywhere after trying to add
> the Date and DateFormat objects to my application. I have imported
> java.util.* and java.text.DateFormat, but I get an error that, for
> example:
> date=new Date();
> cannot find variable date
>
> Does android not like java classes? Thanks.
>
> --
> Have a great day,
> Alex (msg sent from GMail website)
> mehg...@gmail.com; http://www.facebook.com/mehgcap
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> android-beginners+unsubscr...@googlegroups.com<android-beginners%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

To unsubscribe from this group, send email to 
android-beginners+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.