你好朋友需要帮助!
我正在使用 Android,在我的应用程序中,需要一次设置多个提醒。像这样的东西
for( int i = 0; i < n; i++)
{
// Code to set Reminder
}
目前我有以下代码,但一次只能用于一个提醒。
StringTokenizer st=new StringTokenizer(strDateForReminder, "-");
cal.set(Calendar.DAY_OF_MONTH, Integer.parseInt(st.nextToken()));
cal.set(Calendar.MONTH, Integer.parseInt(st.nextToken())-1);
cal.set(Calendar.YEAR, Integer.parseInt(st.nextToken()));
String strTime= textView.getText().toString().trim();
// Toast.makeText(getApplicationContext(), "strTime= "+strTime, Toast.LENGTH_LONG).show();
String[] strTimeArray = strTime.split(getResources().getString(R.string.delimiter));
String[] strFirstTime=strTimeArray[0].split(":");
cal.set(Calendar.HOUR_OF_DAY, Integer.parseInt(strFirstTime[0]));
cal.set(Calendar.MINUTE, Integer.parseInt(strFirstTime[1]));
cal.set(Calendar.SECOND, 00);
Intent intent = new Intent(Intent.ACTION_EDIT);
intent.setType("vnd.android.cursor.item/event");
intent.putExtra("beginTime", cal.getTimeInMillis());
intent.putExtra("endTime", cal.getTimeInMillis()+90*60*1000);
intent.putExtra("title", "Reminder");
startActivity(intent);
请帮忙。提前致谢!