android-appcompat

Application crash on some devices with android.support.v7.widget.ContentFrameLayout.setDecorPadding

随声附和 提交于 2021-02-07 06:18:06
问题 Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mypackage/com.mypackage.activities.HomeActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.ContentFrameLayout.setDecorPadding(int, int, int, int)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2721) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2782) at android.app

I can't use API reflection on androidx.appcompat:appcompat:1.1.0

安稳与你 提交于 2021-02-05 12:04:00
问题 I have a problem with androidx.appcompat:appcompat:1.1.0. It's a new problem because on androidx.appcompat:appcompat:1.0.2 it does not exist. I have a code that uses reflection to get mPopup Field from the spinner and set its height. It works very well on appcompat:1.0.2 but not on androidx.appcomppat:appcompat:1.1.0. The code is private void setPopUp() { try { Field popup = getPopupField(); // Get private mPopup member variable and try cast to ListPopupWindow final android.widget

I can't use API reflection on androidx.appcompat:appcompat:1.1.0

拥有回忆 提交于 2021-02-05 12:03:04
问题 I have a problem with androidx.appcompat:appcompat:1.1.0. It's a new problem because on androidx.appcompat:appcompat:1.0.2 it does not exist. I have a code that uses reflection to get mPopup Field from the spinner and set its height. It works very well on appcompat:1.0.2 but not on androidx.appcomppat:appcompat:1.1.0. The code is private void setPopUp() { try { Field popup = getPopupField(); // Get private mPopup member variable and try cast to ListPopupWindow final android.widget

ListView doesn't get styled with theme when using custom adapter

六月ゝ 毕业季﹏ 提交于 2021-01-28 18:00:32
问题 I have minidemo with three fragments. One displays two TextView and an editview directly, the next treat the same layout as rows in a list with custom adapter, the third displays a plain list with standard adapter (simple_list_item_1) The activity uses a standard theme ( Theme.AppCompat.Light.DarkActionBar ), which I have not modified. I would have expected all three blocks to be styled similarly. Instead, the second block with the custom adapter does not seem to get styled according to the

AppCompatSpinner vs android.widget.Spinner for app with min SDK version 14

白昼怎懂夜的黑 提交于 2020-12-30 05:29:23
问题 I am developing application with minimum SDK version 14 Ice-cream sandwitch and targeted version is Android Marshmallow. DO I need to use AppCompatSpinner or normal spinner will work on ICS devices with all material look and feel? 回答1: If you look at the AppCompatSpinner page, you will see the folowing line. This will automatically be used when you use Spinner in your layouts. You should only need to manually use this class when writing custom views. So you don't have to choose between

How does AppCompat inflate layouts that do not explicitly use AppCompat widgets?

半城伤御伤魂 提交于 2020-12-12 06:50:47
问题 It occurred to me while using AppCompat, that I had been using things like Button instead of android.support.v7.widget.AppCompatButton within my layout XML files. I did a test, via view.getClass().getSimpleName() and confirmed that even though I declared it as a Button in the XML, the class being loaded was in fact AppCompatButton . How does this work, under the hood? 回答1: In the process of researching this topic in order to ask the question correctly, I discovered the answer myself. When

How does AppCompat inflate layouts that do not explicitly use AppCompat widgets?

大兔子大兔子 提交于 2020-12-12 06:49:28
问题 It occurred to me while using AppCompat, that I had been using things like Button instead of android.support.v7.widget.AppCompatButton within my layout XML files. I did a test, via view.getClass().getSimpleName() and confirmed that even though I declared it as a Button in the XML, the class being loaded was in fact AppCompatButton . How does this work, under the hood? 回答1: In the process of researching this topic in order to ask the question correctly, I discovered the answer myself. When