在Android的Google日历的周视图 [英] Week View of calendar in android

查看:268
本文介绍了在Android的Google日历的周视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序。现在的点击微调的日历将open.Now该日历应该在周视图和具体的日期我要打电话有一个活动按我requirement.Anybody指导我的。

I am developing an Android application. Now on the click of the Spinner the calendar will open.Now that calendar should be in week view and on click of the specific date I have to call one Activity as per my requirement.Anybody guide me for this.

感谢您的时间。

推荐答案

试试这个,

Calendar c;
int date;
int month;
int year;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.change_booking_date);
    c = Calendar.getInstance();
    dates = new String[7];
    date = c.get(Calendar.DAY_OF_MONTH);
    month = c.get(Calendar.MONTH)+1;
    year = c.get(Calendar.YEAR);
}

递增的日期,并相应地更新它们。

Increment the dates and update them accordingly.

public void updateDate() {
    if (date > c.getMaximum(Calendar.DAY_OF_MONTH)) {
        date = 1;
        month++;
        updateMonth();
    }
    else 
        date++;
}
public void updateMonth() {
    if (month > c.getMaximum(Calendar.MONTH)) {
        month = 1;
        year++;
    }
    else
        month++;
}

这篇关于在Android的Google日历的周视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆