У нас есть следующий cra sh LOT ... он исходит только от устройств Huawei P30 с Android 10
android.view.InflateException: Binary XML file line #67 in com.app.test:layout/view_flight_leg: Binary XML file line #67 in com.app.test:layout/view_flight_leg: Error inflating class com.app.test.views.FlightProgressBar
at java.lang.reflect.Constructor.newInstance0(Constructor.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:864)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1016)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:971)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1133)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1094)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1136)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1094)
at android.view.LayoutInflater.inflate(LayoutInflater.java:692)
at android.view.LayoutInflater.inflate(LayoutInflater.java:536)
at com.app.test.views.FlightLegView.<init>(FlightLegView.java:54)
at com.app.test.views.FlightLegView.<init>(FlightLegView.java:69)
at com.app.test.views.FlightLegView.<init>(FlightLegView.java:73)
at com.app.test.PlaneDetailPageFragment.setupFlightProgress(PlaneDetailPageFragment.java:104)
at com.app.test.PlaneDetailOverviewFragment.setupPlaneUI(PlaneDetailOverviewFragment.java:270)
at com.app.test.PlaneDetailOverviewFragment.onViewCreated(PlaneDetailOverviewFragment.java:152)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:892)
at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)
at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824)
at androidx.fragment.app.FragmentManagerImpl.execSingleAction(FragmentManagerImpl.java:1696)
at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:299)
at androidx.fragment.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:235)
at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1244)
at androidx.viewpager.widget.ViewPager.populate(ViewPager.java:1092)
at androidx.viewpager.widget.ViewPager.onMeasure(ViewPager.java:1622)
at android.view.View.measure(View.java:24729)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6903)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:24729)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:1002)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:728)
at android.view.View.measure(View.java:24729)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6903)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:24729)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:1002)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:728)
at android.view.View.measure(View.java:24729)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6903)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:24729)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6903)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:143)
at android.view.View.measure(View.java:24729)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6903)
at androidx.appcompat.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:403)
at android.view.View.measure(View.java:24729)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6903)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:24729)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6903)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1562)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:849)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:728)
at android.view.View.measure(View.java:24729)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6903)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at com.android.internal.policy.DecorView.onMeasure(DecorView.java:896)
at android.view.View.measure(View.java:24729)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3206)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1969)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2290)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1852)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8084)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1057)
at android.view.Choreographer.doCallbacks(Choreographer.java:875)
at android.view.Choreographer.doFrame(Choreographer.java:776)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1042)
at android.os.Handler.handleCallback(Handler.java:888)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:8147)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void java.util.List.clear()' on a null object reference
at android.widget.AbsSeekBar.updateGestureExclusionRects(AbsSeekBar.java:779)
at android.widget.AbsSeekBar.setThumbPos(AbsSeekBar.java:763)
at android.widget.AbsSeekBar.onVisualProgressChanged(AbsSeekBar.java:657)
at android.widget.ProgressBar.setVisualProgress(ProgressBar.java:1653)
at android.widget.ProgressBar.doRefreshProgress(ProgressBar.java:1605)
at android.widget.ProgressBar.refreshProgress(ProgressBar.java:1670)
at android.widget.ProgressBar.setProgressInternal(ProgressBar.java:1742)
at android.widget.ProgressBar.setProgress(ProgressBar.java:1706)
at com.app.test.views.FlightProgressBar.setProgress(FlightProgressBar.java:98)
at android.widget.ProgressBar.<init>(ProgressBar.java:336)
at android.widget.AbsSeekBar.<init>(AbsSeekBar.java:120)
at android.widget.SeekBar.<init>(SeekBar.java:89)
at android.widget.SeekBar.<init>(SeekBar.java:85)
at androidx.appcompat.widget.AppCompatSeekBar.<init>(AppCompatSeekBar.java:47)
at androidx.appcompat.widget.AppCompatSeekBar.<init>(AppCompatSeekBar.java:43)
at com.app.test.views.FlightProgressBar.<init>(FlightProgressBar.java:36)
Я не могу понять, почему это так, все остальные Android 10 (и ниже) устройства в порядке.
Обновление с помощью setProgress ()
@Override
public synchronized void setProgress(int progress) {
if (!mShowThumb) {
setThumb(getResources().getDrawable(R.drawable.scrubber_flight_invisible));
} else {
setThumb(mThumb);
}
super.setProgress(progress);
}