Comments (6)
Could you please share the code where using the calendar. One know issue could me inside fragment where you are using getActivity().getSupportFragment()
, replace it will getChildFragmentManager()
.
And it is not Calendars issue, Calendar contains fragment and you are using a fragment inside a fragment.
from weekcalendar.
i am using tabhost and this tabs contains fragments when press to fragment that contain calendar
execute this method firt 👍
private void SetupCalendar() {
selected_date = Calendar.getInstance();
updated_date = Calendar.getInstance();
txtDate_format = new SimpleDateFormat("EEEE MMMM dd, yyyy");
date_format = new SimpleDateFormat("yyyy-MM-dd");
// set current date
// Note calendar start month index from 0 so month number will be -1
Calendar c = Calendar.getInstance();
selected_year = c.get(Calendar.YEAR);
selected_month = c.get(Calendar.MONTH);
selected_day = c.get(Calendar.DAY_OF_MONTH);
// set current date in Textview
String folderName = txtDate_format.format(c.getTime());
tv_selected_date.setText(folderName);
tv_selected_date.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ShowCalendar();
}
});
// when click on swipe calendar
weekCalendar.setOnDateClickListener(new OnDateClickListener() {
@Override
public void onDateClick(DateTime dateTime) {
selected_date.set(Calendar.YEAR, dateTime.getYear());
selected_date.set(Calendar.MONTH, dateTime.getMonthOfYear());
selected_date.set(Calendar.DAY_OF_MONTH, dateTime.getDayOfMonth());
selected_year = dateTime.getYear();
selected_month = dateTime.getMonthOfYear() - 1;
selected_day = dateTime.getDayOfMonth();
try {
Date folderName1 = date_format.parse(dateTime.toString());
Log.e("selected_date", selected_date + "");
tv_selected_date.setText(txtDate_format.format(folderName1));
} catch (Exception e) {
Log.e("date error", "" + e);
}
}
});
}
from weekcalendar.
I get the same problem whenever I put more than one WeekCalendar on a fragment, e.g., I have an adapter where some items contain two WeekCalendars, but only the first one of the whole screen loads the days.
Is this a known issue or is there a limit of how many calendars can you load on the same fragment/activity?
Thank you, if I find anything else that relates to this problem I'll update you!
Edit: When having multiple fragments, each with a calendar, when the one that is showing the days is garbage collected, the next one that loads will be the one that show days.
from weekcalendar.
+1, same here!
from weekcalendar.
+1 same here!
from weekcalendar.
+1 same here!
from weekcalendar.
Related Issues (20)
- Bug , while putting weekcalendar into viewpager HOT 2
- Caused by: java.lang.ClassCastException: com.zing.chat.activity.MainActivity cannot be cast to android.support.v7.app.AppCompatActivity HOT 1
- Enable scroll only for current month.
- min Date and Max Date HOT 1
- text days uppercase
- About week count of year
- Show month name
- Proguard Rules for this library HOT 2
- how can setNextweek and setPervious on button ckick HOT 1
- Dates Selected
- How can i use in Xamarin.Android?
- after proguard why click event not work
- Unable to inflate it HOT 2
- It's possible to select month also like days
- not auto scroll on programmatically selected date HOT 1
- Selected Background
- Calendar Not Display in View pager with Fragment HOT 1
- add day from sunday HOT 1
- Not a best library to add in Fragment or ViewPager
- app:todaysDateTextColor not found
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from weekcalendar.