0

Here's the errors I get, if you need the activities or xml just says and I will post it ;)

Don't know if its because the images or what please help ...Thank you so much it means a lot :D

04-02 14:00:48.128 1448-1448/? E/AndroidRuntime: FATAL EXCEPTION: main
                                             Process: app.alexdickson.com.workout1, PID: 1448
                                             java.lang.RuntimeException: Unable to start activity ComponentInfo{app.alexdickson.com.workout1/app.alexdickson.com.workout1.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390)
                                                 at android.app.ActivityThread.access$800(ActivityThread.java:151)
                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                 at android.os.Looper.loop(Looper.java:135)
                                                 at android.app.ActivityThread.main(ActivityThread.java:5257)
                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                 at java.lang.reflect.Method.invoke(Method.java:372)
                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
                                              Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
                                                 at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:310)
                                                 at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:279)
                                                 at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:253)
                                                 at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
                                                 at app.alexdickson.com.workout1.MainActivity.onCreate(MainActivity.java:18)
                                                 at android.app.Activity.performCreate(Activity.java:5990)
                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2390) 
                                                 at android.app.ActivityThread.access$800(ActivityThread.java:151) 
                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
                                                 at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                 at android.os.Looper.loop(Looper.java:135) 
                                                 at android.app.ActivityThread.main(ActivityThread.java:5257) 
                                                 at java.lang.reflect.Method.invoke(Native Method) 
                                                 at java.lang.reflect.Method.invoke(Method.java:372) 
                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) 
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

04-02 14:01:28.432 1415-1424/? E/StrictMode: A resource was acquired         at attached stack trace but never released. See java.io.Closeable for   information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:71)
                                             at android.os.Binder.execTransact(Binder.java:446)

04-02 14:01:28.441 1415-1424/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:64)
                                             at android.os.Binder.execTransact(Binder.java:446)
04-02 14:01:28.470 1415-1424/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:57)
                                             at android.os.Binder.execTransact(Binder.java:446)


04-02 14:01:32.716 1572-1581/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:57)
                                             at android.os.Binder.execTransact(Binder.java:446)
04-02 14:01:32.721 1572-1581/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:64)
                                             at android.os.Binder.execTransact(Binder.java:446)
04-02 14:01:32.723 1572-1581/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:71)
                                             at android.os.Binder.execTransact(Binder.java:446)
04-02 14:01:32.929 1588-1597/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:57)
                                             at android.os.Binder.execTransact(Binder.java:446)
04-02 14:01:32.932 1588-1597/? E/StrictMode: A resource was acquired    at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:64)
                                             at android.os.Binder.execTransact(Binder.java:446)
04-02 14:01:32.934 1588-1597/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:71)
                                             at android.os.Binder.execTransact(Binder.java:446)
04-02 14:01:33.634 1607-1616/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:57)
                                             at android.os.Binder.execTransact(Binder.java:446)
04-02 14:01:33.646 1607-1616/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:64)
                                             at android.os.Binder.execTransact(Binder.java:446)
04-02 14:01:33.648 1607-1616/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:71)
                                             at android.os.Binder.execTransact(Binder.java:446)
04-02 14:01:33.981 1626-1636/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:57)
                                             at android.os.Binder.execTransact(Binder.java:446)
04-02 14:01:33.984 1626-1636/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:64)
                                             at android.os.Binder.execTransact(Binder.java:446)
04-02 14:01:34.001 1626-1636/? E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
                                         java.lang.Throwable: Explicit termination method 'close' not called
                                             at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                                             at android.os.ParcelFileDescriptor.<init>(ParcelFileDescriptor.java:180)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:916)
                                             at android.os.ParcelFileDescriptor$1.createFromParcel(ParcelFileDescriptor.java:906)
                                             at android.app.IBackupAgent$Stub.onTransact(IBackupAgent.java:71)
                                             at android.os.Binder.execTransact(Binder.java:446)

Here are all of the errors

Here's my xml:

<?xml version="1.0" encoding="utf-8"?>

<application
    android:allowBackup="true"
    android:icon="@mipmap/logo"
    android:label="workout"
    android:theme="@style/MyTheme">
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>

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

    </activity>
    <activity
        android:name=".Main2Activity"
        android:label="@string/title_activity_main2">
        <intent-filter>
        <action android:name="android.intent.action.MAIN"/>


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

    </activity>
</application>
<receiver android:name=".Alarm_Receiver1"/>
<receiver android:name=".Alarm_Receiver2"/>

styles.xml:

<resources>

    <style name="MyTheme" parent="@android:style/Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/MyActionBar</item>">

</style>

<style name="MyActionBar" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">@color/colorVerd</item>
    <item name="android:textColor">@color/colorBlanc</item>
</style>

2 Answers2

1

You need to use Appcompat Themes instead of Holo themes

Replace Theme.Holo.Light with Theme.AppCompat.Light

(I think that's the corresponding one, there's also one with NoActionBar)

Also, this line looks misconfigured in your XML. There's an extra quote at the end.

<item name="android:actionBarStyle">@style/MyActionBar</item>">
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • Now it works but I dont get the theme i wanted where there was a green action bar with the name of the app and its logo, it appears with a white action bar with the name of the activity, not the name of the app, and with no logo @cricket_007 – Alexia White Apr 02 '16 at 13:24
  • @cricket_007 – Alexia White Apr 02 '16 at 13:26
  • And what happens when you use the `Theme.AppCompat.Light.NoActionBar`? I don't know what your code is doing, so you very likely could be loading in two Toolbars. I recommend finding a tutorial on how to properly implement the AppCompatActivity with a toolbar because you are missing some colors from the theme style – OneCricketeer Apr 02 '16 at 14:36
-1

add this in your manifest file

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme">
Nitesh
  • 318
  • 3
  • 16