Show Date Widget.

General topics about the Android-Platform itself.
Coding issues please to the subforum right below.

Show Date Widget.

Postby venkat » Tue Mar 18, 2008 5:57 pm

Hi to all,

Below lines of coding, I can show Date Widget. Now i want to handle the events. i don't know how to handle it :(
for Example, if i click on the calendar message box will display with that date.
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2.  
  3.  
  4. import java.util.Calendar;
  5.  
  6. import android.app.Activity;
  7.  
  8. import android.os.Bundle;
  9.  
  10. import android.widget.DatePicker;
  11.  
  12.  
  13.  
  14. public class showdate extends Activity {
  15.  
  16.     /** Called when the activity is first created. */
  17.  
  18.     @Override
  19.  
  20.     public void onCreate(Bundle icicle)
  21.  
  22.     {
  23.  
  24.         super.onCreate(icicle);
  25.  
  26.         setContentView(R.layout.main);
  27.  
  28.  
  29.  
  30.         DatePicker dp = (DatePicker)this.findViewById(R.id.date);
  31.  
  32.  
  33.  
  34.         // for example init to 1/27/2008, no callback
  35.  
  36.         dp.init(2008, 0, 27, Calendar.MONDAY, null);  
  37.  
  38.     }
  39.  
  40. }
Parsed in 0.033 seconds, using GeSHi 1.0.8.4

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2.  
  3.  
  4.  
  5.  
  6. <?xml version="1.0" encoding="utf-8"?>
  7.  
  8. <AbsoluteLayout
  9.  
  10. android:layout_width="fill_parent"
  11.  
  12. android:layout_height="fill_parent"
  13.  
  14. xmlns:android="http://schemas.android.com/apk/res/android"
  15.  
  16. >
  17.  
  18. <DatePicker
  19.  
  20. android:id="@+id/date"
  21.  
  22. android:layout_width="fill_parent"
  23.  
  24. android:layout_height="fill_parent"
  25.  
  26. android:layout_x="0px"
  27.  
  28. android:layout_y="0px"
  29.  
  30. >
  31.  
  32. </DatePicker>
  33.  
  34. </AbsoluteLayout>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


any one help me solve this problem please...
Thanks in advance :)
Regards,
Venkat.
venkat
Senior Developer
Senior Developer
 
Posts: 152
Joined: Tue Nov 27, 2007 5:42 am
Location: India

Top

Postby erbedo » Wed Mar 19, 2008 1:16 am

You need to implement item like onClick(), if I understood your question... ?
Proudly supporting Android :)
erbedo
Junior Developer
Junior Developer
 
Posts: 22
Joined: Thu Mar 13, 2008 9:39 pm

Postby venkat » Wed Mar 19, 2008 12:07 pm

Thanks erbedo :), just now only i got it. :)
Regards,
Venkat.
venkat
Senior Developer
Senior Developer
 
Posts: 152
Joined: Tue Nov 27, 2007 5:42 am
Location: India

Top

Return to General

Who is online

Users browsing this forum: No registered users and 6 guests