Friday, 15 July 2011

java - How to implement time square calendar app -



java - How to implement time square calendar app -

the link calendar app https://github.com/square/android-times-square#usage

i'm trying implement calendar app project, , i've been having hardest time. set code main activity xml told me

<framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.example.chexity.mainactivity" tools:ignore="mergerootframe" > <com.squareup.timessquare.calendarpickerview android:id="@+id/calendar_view" android:layout_width="match_parent" android:layout_height="match_parent" /> </framelayout>

and set code main activity's oncreate

package com.example.chexity; import java.util.calendar; import java.util.date; import android.support.v7.app.actionbaractivity; import android.support.v7.app.actionbar; import android.support.v4.app.fragment; import android.app.activity; import android.os.bundle; import android.view.layoutinflater; import android.view.menu; import android.view.menuitem; import android.view.view; import android.view.viewgroup; import android.os.build; public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); calendar nextyear = calendar.getinstance(); nextyear.add(calendar.year, 1); calendarpickerview calendar = (calendarpickerview) findviewbyid(r.id.calendar_view); date today = new date(); calendar.init(today, nextyear.gettime()) .withselecteddate(today); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); homecoming true; } @override public boolean onoptionsitemselected(menuitem item) { // handle action bar item clicks here. action bar // automatically handle clicks on home/up button, long // specify parent activity in androidmanifest.xml. int id = item.getitemid(); if (id == r.id.action_settings) { homecoming true; } homecoming super.onoptionsitemselected(item); } /** * placeholder fragment containing simple view. */ public static class placeholderfragment extends fragment { public placeholderfragment() { } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_main, container, false); homecoming rootview; } } }

but maintain getting errors on line

calendarpickerview calendar = (calendarpickerview) findviewbyid(r.id.calendar_view);

and on init method.

saying calendarpickerview cannot resolved type. imported library the calendar bundle downloaded. don't know wrong. can provide insight?

i running on version max 4.4 , min 2.2.

you haven't imported calendarpickerview mainactivity.java file. seek this:

import com.squareup.timessquare.calendarpickerview;

where other import statements are.

java android calendar implementation

No comments:

Post a Comment