Read about how to restore calendar on android, The latest news, videos, and discussion topics about how to restore calendar on android from alibabacloud.com
2015 Android Case tour case eight: Registration calendar knowledge Points:
Use of the GridView
Use of SQLite
Documents involved:
Res->layout->activity_main.xml Main layout file
Res->layout->date.xml Layout file
Src->db->dbhelper.javajava file
Src->db->signdao.javajava file
Src->activity->mainactivity.javajava file
Activity_main.xmlDate.xml Mainactivity.javap
Recyclerview each line display sevenIn the custom data adapter, we parse the returned results and set different background colors based on the results. public void Onbindviewholder (Myviewholder holder, final int position) {FileList da=mdatas.get (position); Holder.v.setbackgroundcolor (Color.White); String msg=da.getmsg (); if (listener! = null) {Holder.v.setonclicklistener (new View.onclicklistener () {@Override public void OnClick (View v) {Listene
1. A few days ago someone asked me to remember when she washed the hair, and then remember to remind her, so complex things, I had to think of something to help me, and then this is 2. Just look at the effect.Initial situationClick on one as a markerClick once again to delete3. Here also to thank the predecessors of the Code as a reference, after all, have not written about the calendar aspects of things, others did write well, I added on the original
Android:selectedweekbackgroundcolor
Setselectedweekbackgroundcolor (int)
Sets the background color of the selected week
Android:showweeknumber
Setshowweeknumber (Boolean)
Set whether to show the week
Android:shownweekcount
Setshownweekcount (int)
Set the number of weeks to display
Android:unfocusedmonthdatecolor
Setunfocusedmonthdatecolor (int)
Sets the color of the month date text without focus
See the number on the iphone calendar icon will change with the date changes, recently on the Android platform also studied, the implementation method is as follows:directly on the sourceChanged it in the launcher.First, in the Iconcache.java file, find the method private CacheEntry cachelocked (componentname componentname, ResolveInfo info,HashmapIn Entry.icon = Utilities.createiconbitmap (icon, mcontext);
To create a calendar:
Calendar cal = Calendar.getinstance ();Intent Intent = new Intent (intent.action_edit);Intent.settype ("Vnd.android.cursor.item/event");Intent.putextra ("BeginTime", Cal.gettimeinmillis ());Intent.putextra ("AllDay", true);Intent.putextra ("Rrule", "freq=yearly");Intent.putextra ("Endtime", Cal.gettimeinmillis () +60*60*1000);Intent.putextra ("title", "A Test Event from
1. Add 1 for monthCanlendar.month + 1Because the Roman calendar is used, the value returned by Calendar.month is not the month of the year, but the difference from the first month in the current month.For example: The current month is September, distance January, the difference is 8, so canlendar.month returns 8 instead of 92. When to get a week minus 1Calendar.day_of_week-1Getting the current date is the day of the week when it's time to think about
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.