1

I get this error even though I use the AppCompat theme. Everything was working fine, and after changing some fragment class lines, it started popping this error. I tried to undo all last changes to get back on the last working state but the error is still here. I now that there is a lot of posts with this problem, but something else is wrong here. What else could be a problem?

MainActivity.java

package com.example.currencyconverter;

    import androidx.appcompat.app.AppCompatActivity;
    import androidx.viewpager.widget.PagerAdapter;
    import androidx.viewpager.widget.ViewPager;

    import android.os.Bundle;

    import com.google.android.material.tabs.TabLayout;

    public class MainActivity extends AppCompatActivity {

        private ViewPager mViewPager;
        private TabLayout mTabLayout;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            initViews();
            setUpPager();
        }


        private void initViews(){
            mViewPager = findViewById(R.id.viewPager);
            mTabLayout = findViewById(R.id.tab);
        }

        private void setUpPager(){
            PagerAdapter  pagerAdapter = new ScreenSlidePagerAdapter(getSupportFragmentManager());
            mViewPager.setAdapter(pagerAdapter);
            mTabLayout.setupWithViewPager(mViewPager);
        }

    }

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        package="com.example.currencyconverter">
        <uses-permission android:name="android.permission.INTERNET"/>

        <application
            android:allowBackup="true"
            android:icon="@drawable/icon"
            android:label="@string/app_name"
            android:roundIcon="@mipmap/ic_launcher_round"
            android:supportsRtl="true"
            android:theme="@style/AppTheme"
            tools:ignore="GoogleAppIndexingWarning">
            <activity android:name=".MainActivity"
                android:configChanges="orientation"
                android:screenOrientation="portrait">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />

                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>

        </application>

    </manifest>

styles.xml

<resources>

        <!-- Base application theme. -->
        <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
            <!-- Customize your theme here. -->
            <item name="colorPrimary">@color/colorPrimary</item>
            <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
            <item name="colorAccent">@color/colorAccent</item>
        </style>
        <style name="MatchSpinnerStyle" parent="android:style/Widget.ListView.DropDown">
            <item name="android:divider">#123456</item>
            <item name="android:dividerHeight">1dp</item>
        </style>

        <style name="MatchSpinnerTheme" parent="AppTheme">
            <item name="android:dropDownListViewStyle">@style/MatchSpinnerStyle</item>
        </style>
        <style name="MineCustomTabText" parent="TextAppearance.Design.Tab">
            <item name="android:textSize">20sp</item>
        </style>

    </resources>

0 Answers0