资源简介
android个人日程管理系统,含源代码,项目截图,说明文档,保证可以正常完整运行!
代码片段和文件信息
package com.zhike.activity;
import java.util.Calendar;
import java.util.GregorianCalendar;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.app.ListActivity;
import android.content.Intent;
import android.content.res.Configuration;
import android.database.Cursor;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.ContextMenu;
import android.view.GestureDetector;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.View.OnTouchListener;
import android.widget.ListView;
import android.widget.RatingBar;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
import android.widget.AdapterView.AdapterContextMenuInfo;
import com.zhike.R;
import com.zhike.provider.DiaryAdapter;
import com.zhike.provider.ThoughtsAdapter;
import com.zhike.provider.SyncLogAdapter;
import com.zhike.util.TimeDiary;
/**
*@author 论文汇(www.lunwenhui.com)
*部分源代码
*/
public class DiaryList extends ListActivity {
private static final int ACTIVITY_EDIT = 1;
private static final int DELETE_ID = Menu.FIRST ;
private static final int DATE_DIALOG_ID = 1;
private DiaryAdapter dbApt;
private TextView mSelectDateView;
private String mSelectDate;
private int mYear;
private int mMonth;
private int mDay;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.diary_list);
ListView listView = (ListView) findViewById(android.R.id.list);
listView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View view MotionEvent event) {
mGestureDetector.onTouchEvent(event);
return view.onTouchEvent(event);
}
});
// 获取日期并设置
Bundle extras = getIntent().getExtras();
Calendar c = (Calendar) (extras != null ? extras.getSerializable(“cal“): null);
if (c == null) {
c = Calendar.getInstance();
}
mYear = savedInstanceState != null ? savedInstanceState.getInt(“year“): -1;
mMonth = savedInstanceState != null ? savedInstanceState.getInt(“month“) : -1;
mDay = savedInstanceState != null ? savedInstanceState.getInt(“day“): -1;
if (mYear == -1 || mMonth == -1 || mDay == -1) {
mYear = c.get(Calendar.YEAR);
mMonth = c.get(Calendar.MONTH);
mDay = c.get(Calendar.DAY_OF_MONTH);
}
updateDisplay();
// 获取列表数据
dbApt = new DiaryAdapter(this);
dbApt.open();
fillData();
// 注册上下文菜单
registerForContextMenu(getListView());
}
@Override
protected void onPrepareDialog(int id Dialog dialog) {
switch (id) {
case DATE_DIALOG_ID:
((DatePickerDialog) dialog).updateDate(mYear mMonth mDay);
break;
}
}
private void fillData() {
Cursor timeItemsCursor = dbApt.fetchAllDiariesByDate(mSelectDate);
startManagingCursor(timeItemsCursor);
Str
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-12-24 23:44 android个人日程管理系统\
文件 687 2012-12-24 23:45 android个人日程管理系统\说明.txt
目录 0 2012-12-24 23:47 android个人日程管理系统\部分源码\
文件 7854 2012-12-24 23:48 android个人日程管理系统\部分源码\DiaryList.java
目录 0 2012-12-24 23:46 android个人日程管理系统\项目截图\
文件 225236 2012-12-15 02:36 android个人日程管理系统\项目截图\1.png
文件 252058 2012-12-15 02:36 android个人日程管理系统\项目截图\2.png
文件 241325 2012-12-15 02:36 android个人日程管理系统\项目截图\3.png
文件 73992 2012-12-15 02:36 android个人日程管理系统\项目截图\4.png
- 上一篇:java求解素数环问题
- 下一篇:Java程序员面试笔试宝典附录答案与勘误
评论
共有 条评论