android-support-library

Android O - Notification Channels and NotificationCompat

孤者浪人 提交于 2020-06-09 11:44:28
问题 I cannot change this feeling: again, the Android developers came up with something new and leave everybody in the dark about how they would think the feature is used. I am talking about Notification Channels in Android O. For years I have been using the compatibility support libraries to avoid dealing with specific platform details. Namely: NotificationCompat . Now, the Builder requires me to supply a notification channel id, which is nice, but completely leaves me alone with creating such a

SwipeRefreshLayout not working

泪湿孤枕 提交于 2020-05-29 04:46:05
问题 I'm using SwipeRefreshListener from the support libraries. I am calling setRefresh from onPreExecute and onPostExecute of my AsyncTask . However, nothing changes, there is no animation. Is there something that I'm missing? Are there certain setup parameters I need to set in order for it to work properly? 回答1: This has worked for me, see more here: http://antonioleiva.com/swiperefreshlayout/ SwipeRefreshLayout: The layout you only need to decorate the swipable content (probable the whole

OutlinedBox TextInputLayout and gravity center?

烂漫一生 提交于 2020-05-22 07:59:50
问题 How to achieve centered new OutlinedBox style with TextInputLayout ? Current behavior: <android.support.design.widget.TextInputLayout android:id="@+id/textInputLayout2" style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="left" > <android.support.design.widget.TextInputEditText android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="left" android:hint=

Android InstantiationException With Fragment (It Is Public)

China☆狼群 提交于 2020-04-10 07:12:31
问题 I have a Fragment (it is not an inner class, and it does not have any constructor whatsoever) public class PreferenceListFragment extends ListFragment implements OnClickListener I'm getting this crash report on the Android Developer Console: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.redacted.redacted/com.redacted.redacted.PreferenceActivity}: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.redacted.redacted

Android InstantiationException With Fragment (It Is Public)

北城余情 提交于 2020-04-10 07:12:28
问题 I have a Fragment (it is not an inner class, and it does not have any constructor whatsoever) public class PreferenceListFragment extends ListFragment implements OnClickListener I'm getting this crash report on the Android Developer Console: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.redacted.redacted/com.redacted.redacted.PreferenceActivity}: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.redacted.redacted

Why is ContextThemeWrapper now restricted to the Support Library group?

a 夏天 提交于 2020-04-08 18:51:04
问题 I started using a ContextThemeWrapper to apply a style dynamically to an ImageButton ; based an answer to another question of mine, and answers to other similar questions. ContextThemeWrapper wrapper = new ContextThemeWrapper(getContext(), mStyleRes); mImageButton = new AppCompatImageButton(wrapper, null, 0); But recently a lint error started appearing on the ContextThemeWrapper constructor stating: ContextThemeWrapper can only be called from within the same library group (groupId=com.android

Why is ContextThemeWrapper now restricted to the Support Library group?

巧了我就是萌 提交于 2020-04-08 18:49:49
问题 I started using a ContextThemeWrapper to apply a style dynamically to an ImageButton ; based an answer to another question of mine, and answers to other similar questions. ContextThemeWrapper wrapper = new ContextThemeWrapper(getContext(), mStyleRes); mImageButton = new AppCompatImageButton(wrapper, null, 0); But recently a lint error started appearing on the ContextThemeWrapper constructor stating: ContextThemeWrapper can only be called from within the same library group (groupId=com.android

Why is ContextThemeWrapper now restricted to the Support Library group?

梦想与她 提交于 2020-04-08 18:48:54
问题 I started using a ContextThemeWrapper to apply a style dynamically to an ImageButton ; based an answer to another question of mine, and answers to other similar questions. ContextThemeWrapper wrapper = new ContextThemeWrapper(getContext(), mStyleRes); mImageButton = new AppCompatImageButton(wrapper, null, 0); But recently a lint error started appearing on the ContextThemeWrapper constructor stating: ContextThemeWrapper can only be called from within the same library group (groupId=com.android

Cannot switch between modes in DayNight theme dynamically

谁都会走 提交于 2020-04-08 09:36:08
问题 I implemented the DayNight theme in my app and added a setting to switch between day and night mode, but I'm not able to switch between modes dynamically without a restart. If I use setDefaultNightMode() after the setting has been changed, the settings activity doesn't change mode, but the activities in the backstack do. If I additionally use setLocalNightMode() the settings activity gets recreated and changes its mode, but now the activities in the backstack don't. I could not find a way to

Cannot switch between modes in DayNight theme dynamically

本小妞迷上赌 提交于 2020-04-08 09:33:06
问题 I implemented the DayNight theme in my app and added a setting to switch between day and night mode, but I'm not able to switch between modes dynamically without a restart. If I use setDefaultNightMode() after the setting has been changed, the settings activity doesn't change mode, but the activities in the backstack do. If I additionally use setLocalNightMode() the settings activity gets recreated and changes its mode, but now the activities in the backstack don't. I could not find a way to