android-calendar

Is there any way to detect month change in android calendar view(i.e. when user changes calendar to another month)

偶尔善良 提交于 2019-12-03 12:04:50
问题 I want to get month shown in calendar view and i cant figure it out. i tried calendarView.setOnDateChangeListener(new CalendarView.OnDateChangeListener() { @Override public void onSelectedDayChange(CalendarView view, int year, int month, int dayOfMonth) { int d = dayOfMonth; int m = month; Log.d("month", "" + m); String curDate = String.valueOf(d); } }); but it only triggers when user click to the days of month. What i want is when user changes the month i want the changed month(i.e. the

Why does the datepicker add a calendar in my view?

我与影子孤独终老i 提交于 2019-12-03 09:35:23
I am starting to learn how to develop on Android. It is pretty straightforward but I'm facing an issue I did not find any mention anywhere... I have a view : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingLeft="16dp" android:paddingRight="16dp" android:orientation="vertical"> <EditText android:id="@+id/editNomProduit" android:layout_width="fill_parent" android:layout_height="wrap_content" android:ems="10" android:hint="@string/ht_nom_produit" />

CalendarView takes much time for displaying

ⅰ亾dé卋堺 提交于 2019-12-03 03:52:12
i am working on an application on CalendarView. i have to show calendarView in a small linear-layout. problem occurs while displaying a whole page which contains calendarView in small Linear-layout. -> this takes 10 seconds to show,& this is much time... there is no other thing in layout. here is my xml and snap... any help would be strongly appriciated... <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <LinearLayout android

Is there any way to detect month change in android calendar view(i.e. when user changes calendar to another month)

二次信任 提交于 2019-12-03 03:22:59
I want to get month shown in calendar view and i cant figure it out. i tried calendarView.setOnDateChangeListener(new CalendarView.OnDateChangeListener() { @Override public void onSelectedDayChange(CalendarView view, int year, int month, int dayOfMonth) { int d = dayOfMonth; int m = month; Log.d("month", "" + m); String curDate = String.valueOf(d); } }); but it only triggers when user click to the days of month. What i want is when user changes the month i want the changed month(i.e. the month shown in calendar view.) Any help would be appreciated. Thanks in advance. I think from Android's

Deleting events from Calendar not being deleted

主宰稳场 提交于 2019-12-03 01:16:22
I am trying to make my App add reminders to the user's Calendar. The code searches for the title and start date to check if the event already exists in the Calendar before adding it (so as not to have duplicates). My problem is that: if I remove the event from the Calendar manually (using the Calendar), the event disappears from the Calendar (I am viewing all my Calendars and can't see it in the Calendar Application) but not from the DataBase. Another thing I don't understand is that I tried to remove the events programmatically, but still they are not removed. Here is my code snippet: Cursor

How to get day, month, year and hour, minutes, second from DateTime format?

匆匆过客 提交于 2019-12-02 12:07:30
I tried this following code but its a deprecated in android SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); try { Date date1 = simpleDateFormat.parse("11/20/2014 8:10:00 AM"); Log.e("date", "" + date1.getYear()); Log.e("month", "" + date1.getmonth()); Log.e("year", "" + date1.getYear()); Log.e("hour", "" + date1.getHours()); Log.e("minutes", "" + date1.getMinutes()); Log.e("seconds", "" + date1.getSeconds()); } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } Its is deprecated how to use calendar and get day, month, year? Set

Ics file is not parsing and retrieving data as expected in android. ( using ical4 library)

有些话、适合烂在心里 提交于 2019-12-02 09:19:22
问题 I am trying to parse ics file using a sample code library : Here's a link to the sample project I am using /referring to: project link As soon as I try to parse the data, it either crashes with a null pointer exception or throws an error saying file cannot be parsed. ( I have added the entire code for the project in my link above, pretty small project). Here's the mainactivity code I am using for that: public class MainActivity extends AppCompatActivity { public static final String TAG =

get previous/next day Date on button press after getting date from previous activity using SharedPreferences android

江枫思渺然 提交于 2019-12-02 07:49:25
In my application I am Using this library for Custom Calender View. On click any date i am passing that date to next activity through shared preferences. I am able to display date in next activity. Now what i want is there are two buttons, one is "Previous" and another one "Next". if i click on any button date has to change according to requirement. Onclick date code is calendarView.setOnDateClickListener(new CalendarView.OnDateClickListener() { @Override public void onDateClick(@NonNull Date selectedDate) { SimpleDateFormat df_new = new SimpleDateFormat("dd-MM-yyyy", Locale.getDefault());

Why duration is NULL for recurrent event in android?

倾然丶 夕夏残阳落幕 提交于 2019-12-02 05:00:17
问题 I try to implement one way synchronization with android calendar events (I need original events - not event instances). So, I have the following query: String[] projection = new String[]{ CalendarContract.Events.DTSTART, CalendarContract.Events.EVENT_TIMEZONE, CalendarContract.Events.DTEND, CalendarContract.Events.EVENT_END_TIMEZONE, CalendarContract.Events.DURATION }; String selection = null; String[] args = new String[0]; String sort = CalendarContract.Events.DTSTART + " ASC"; Cursor cursor

Why duration is NULL for recurrent event in android?

[亡魂溺海] 提交于 2019-12-02 02:33:44
I try to implement one way synchronization with android calendar events (I need original events - not event instances). So, I have the following query: String[] projection = new String[]{ CalendarContract.Events.DTSTART, CalendarContract.Events.EVENT_TIMEZONE, CalendarContract.Events.DTEND, CalendarContract.Events.EVENT_END_TIMEZONE, CalendarContract.Events.DURATION }; String selection = null; String[] args = new String[0]; String sort = CalendarContract.Events.DTSTART + " ASC"; Cursor cursor = getContentResolver().query(CalendarContract.Events.CONTENT_URI, projection, selection, args, sort);