Getting java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.widget.RelativeLayout$LayoutParams

Issue Here I need to add textview at runtime. first I took reference of RelativeLayout to get layout params but unfortunately its throwing ClassCastException at RelativeLayout.LayoutParams params = (android.widget.RelativeLayout.LayoutParams)contentLayout.getLayoutParams() I also checked – FrameLayout to RelativeLayout ClassCastException even if there

Continue reading

How count the number of days selected in the daterangepicker materialdesign?

Issue Hello guys I have a DatePickerRange with material design and everything is working perfectly CalendarConstraints.Builder constraitBuilder = new CalendarConstraints.Builder(); constraitBuilder.setStart(mesPresente); constraitBuilder.setEnd(limitDate); // selectedPair = new Pair<>(today,); Selecionar da por default in DateRangePicker //Date Range Picker MaterialDatePicker.Builder<Pair<Long, Long>> builder =

Continue reading

update include tag data when app theme changed (recreating Activity)

Issue I used multiple include tags in a xml layout like this: <include android:id="@+id/firstView" layout="@layout/layout_edit_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginHorizontal="@dimen/normal_margin" android:layout_marginTop="@dimen/normal_margin" /> <include android:id="@+id/secondView" layout="@layout/layout_edit_text" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginHorizontal="@dimen/normal_margin" android:layout_marginTop="@dimen/normal_margin" /> both include tags are the same and they are just an EditText

Continue reading

Android how change background options menu

Issue i have trouble! My options menu (popup menu) background doesn’t change. My Code Style: <style name=”AppTheme” parent=”AppBaseTheme”> <item name=”android:popupMenuStyle”>@style/PopupMenu</item> </style> <style name=”PopupMenu” parent=”@android:style/Widget.Holo.ListPopupWindow”> <item name=”android:popupBackground”>@drawable/menu_dropdown_panel </style> And i generate background image https://i.stack.imgur.com/ukdTk.png But my background still has a dark

Continue reading