Skip to content Skip to sidebar Skip to footer

Logcat Error: App Crashes And Does Not Run. Error At Setcontentview As Per Logcat

I'm developing a basic equation balancing app and am new to android dev. The app does not run on the phone at all. I had a splash screen as launcher previously and that used to pop

Solution 1:

Your MainActivity is extending AppCompatActivity which means it inherits the default action bar.

ThemeOverlay.AppCompat(parent for Theme.ChemicalEquationBalancer.ActionBar) is used to override (or “overlay”) that theme for specific views, especially the Toolbar.

If you want to customize this ActionBar (you are probably doing that), you add one of the NoActionBar themes in your activity's manifest and then supply a toolbar to your activity's layout.

<activityandroid:name="com.example.chemicalequationbalancer.MainActivity"android:label="@string/app_name"android:theme="@style/AppTheme.Light.NoActionBar" ><intent-filter><actionandroid:name="android.intent.action.MAIN" /><categoryandroid:name="android.intent.category.LAUNCHER" /></intent-filter></activity>

In your activity_main.xml, you can add whatever theme you want

<androidx.appcompat.widget.Toolbar
    ...
    android:background="?attr/colorPrimary"
    android:theme="@style/Theme.ChemicalEquationBalancer.ActionBar />

And not in the manifest file

Post a Comment for "Logcat Error: App Crashes And Does Not Run. Error At Setcontentview As Per Logcat"