2016-06-01 15 views
0

Ich glaube, ich in der Lage gewesen mein Hauptproblem zu lösen - durch Leute um Hilfe Allerdings erhalte ich folgende Warnung/Fehlermeldungen in meinem logcat:ANDROID: Starten der Aktivität mit einem Klick auf die Schaltfläche; Die Schaltfläche hat einen Hintergrund. Überschüssiger Speicher Ausgabe

06-03 10:52:25.420 7149-7149/xxx E/dalvikvm: Could not find class 'android.util.ArrayMap', referenced from method com.android.tools.fd.runtime.MonkeyPatcher.monkeyPatchExistingResources 
 
06-03 10:52:25.420 7149-7149/xxx W/dalvikvm: VFY: unable to resolve check-cast 1832 (Landroid/util/ArrayMap;) in Lcom/android/tools/fd/runtime/MonkeyPatcher; 
 
06-03 10:52:25.420 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x1f at 0x0258 
 
06-03 10:52:25.420 7149-7149/xxx E/dalvikvm: Could not find class 'android.util.ArrayMap', referenced from method com.android.tools.fd.runtime.MonkeyPatcher.pruneResourceCache 
 
06-03 10:52:25.420 7149-7149/xxx W/dalvikvm: VFY: unable to resolve const-class 1832 (Landroid/util/ArrayMap;) in Lcom/android/tools/fd/runtime/MonkeyPatcher; 
 
06-03 10:52:25.420 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x1c at 0x0058 
 
06-03 10:52:25.435 7149-7149/xxx I/dalvikvm: Could not find method android.content.Context.getSystemService, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.435 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 512: Landroid/content/Context;.getSystemService (Ljava/lang/Class;)Ljava/lang/Object; 
 
06-03 10:52:25.435 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x004b 
 
06-03 10:52:25.435 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.stopLockTask, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.435 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 248: Landroid/app/Activity;.stopLockTask()V 
 
06-03 10:52:25.435 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x00b9 
 
06-03 10:52:25.435 7149-7149/xxx E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.435 7149-7149/xxx W/dalvikvm: VFY: unable to resolve check-cast 260 (Landroid/os/PersistableBundle;) in Lyyy/MainActivity; 
 
06-03 10:52:25.435 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x1f at 0x00f1 
 
06-03 10:52:25.435 7149-7149/xxx I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.435 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 492: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList; 
 
06-03 10:52:25.435 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0101 
 
06-03 10:52:25.435 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.onVisibleBehindCanceled, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.435 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 168: Landroid/app/Activity;.onVisibleBehindCanceled()V 
 
06-03 10:52:25.435 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0111 
 
06-03 10:52:25.435 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.onWindowStartingActionMode, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.435 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 172: Landroid/app/Activity;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode; 
 
06-03 10:52:25.435 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0137 
 
06-03 10:52:25.435 7149-7149/xxx E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.435 7149-7149/xxx W/dalvikvm: VFY: unable to resolve check-cast 260 (Landroid/os/PersistableBundle;) in Lyyy/MainActivity; 
 
06-03 10:52:25.435 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x1f at 0x019a 
 
06-03 10:52:25.435 7149-7149/xxx E/dalvikvm: Could not find class 'android.media.session.MediaController', referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.435 7149-7149/xxx W/dalvikvm: VFY: unable to resolve check-cast 213 (Landroid/media/session/MediaController;) in Lyyy/MainActivity; 
 
06-03 10:52:25.435 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x1f at 0x01b2 
 
06-03 10:52:25.435 7149-7149/xxx E/dalvikvm: Could not find class 'android.widget.Toolbar', referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.435 7149-7149/xxx W/dalvikvm: VFY: unable to resolve check-cast 2020 (Landroid/widget/Toolbar;) in Lyyy/MainActivity; 
 
06-03 10:52:25.435 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x1f at 0x01bc 
 
06-03 10:52:25.435 2365-2490/? I/CrashAnrDetector: onPackageUpdateFinished : xxx 
 
06-03 10:52:25.435 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.releaseInstance, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.435 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 179: Landroid/app/Activity;.releaseInstance()Z 
 
06-03 10:52:25.435 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x02dd 
 
06-03 10:52:25.435 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.onActivityReenter, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.435 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 112: Landroid/app/Activity;.onActivityReenter (ILandroid/content/Intent;)V 
 
06-03 10:52:25.435 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x02f4 
 
06-03 10:52:25.435 7149-7149/xxx I/dalvikvm: Could not find method android.content.ContextWrapper.getCodeCacheDir, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.435 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 564: Landroid/content/ContextWrapper;.getCodeCacheDir()Ljava/io/File; 
 
06-03 10:52:25.435 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0349 
 
06-03 10:52:25.440 7149-7149/xxx I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/FragmentActivity;.dispatchFragmentsOnCreateView (Landroid/view/View;Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View; from Lyyy/MainActivity;) 
 
06-03 10:52:25.440 7149-7149/xxx I/dalvikvm: Could not find method android.support.v4.app.FragmentActivity.dispatchFragmentsOnCreateView, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.440 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 2580: Landroid/support/v4/app/FragmentActivity;.dispatchFragmentsOnCreateView (Landroid/view/View;Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View; 
 
06-03 10:52:25.440 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0432 
 
06-03 10:52:25.440 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.getVoiceInteractor, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.440 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 91: Landroid/app/Activity;.getVoiceInteractor()Landroid/app/VoiceInteractor; 
 
06-03 10:52:25.440 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0490 
 
06-03 10:52:25.440 7149-7149/xxx E/dalvikvm: Could not find class 'android.app.ActivityManager$TaskDescription', referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.440 7149-7149/xxx W/dalvikvm: VFY: unable to resolve check-cast 26 (Landroid/app/ActivityManager$TaskDescription;) in Lyyy/MainActivity; 
 
06-03 10:52:25.440 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x1f at 0x055b 
 
06-03 10:52:25.440 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.startActionMode, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.440 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 223: Landroid/app/Activity;.startActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode; 
 
06-03 10:52:25.440 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0596 
 
06-03 10:52:25.440 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.showAssist, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.440 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 218: Landroid/app/Activity;.showAssist (Landroid/os/Bundle;)Z 
 
06-03 10:52:25.440 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x05d8 
 
06-03 10:52:25.440 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.postponeEnterTransition, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.440 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 176: Landroid/app/Activity;.postponeEnterTransition()V 
 
06-03 10:52:25.440 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x05e3 
 
06-03 10:52:25.440 7149-7149/xxx I/dalvikvm: Could not find method android.content.ContextWrapper.getNoBackupFilesDir, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.440 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 576: Landroid/content/ContextWrapper;.getNoBackupFilesDir()Ljava/io/File; 
 
06-03 10:52:25.440 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0672 
 
06-03 10:52:25.445 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.requestPermissions, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.445 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 182: Landroid/app/Activity;.requestPermissions ([Ljava/lang/String;I)V 
 
06-03 10:52:25.445 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0787 
 
06-03 10:52:25.445 7149-7149/xxx E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.445 7149-7149/xxx W/dalvikvm: VFY: unable to resolve check-cast 57 (Landroid/app/SharedElementCallback;) in Lyyy/MainActivity; 
 
06-03 10:52:25.445 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x1f at 0x07a1 
 
06-03 10:52:25.445 7149-7149/xxx E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.445 7149-7149/xxx W/dalvikvm: VFY: unable to resolve check-cast 260 (Landroid/os/PersistableBundle;) in Lyyy/MainActivity; 
 
06-03 10:52:25.445 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x1f at 0x07e8 
 
06-03 10:52:25.445 7149-7149/xxx W/dalvikvm: DexOpt: resolve class illegal access: Lyyy/MainActivity; -> Landroid/support/v4/app/BaseFragmentActivityDonut; 
 
06-03 10:52:25.445 7149-7149/xxx I/dalvikvm: Could not find method android.support.v4.app.BaseFragmentActivityDonut.onCreateView, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.445 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 2356: Landroid/support/v4/app/BaseFragmentActivityDonut;.onCreateView (Ljava/lang/String;Landroid/content/Context;Landroid/util/AttributeSet;)Landroid/view/View; 
 
06-03 10:52:25.445 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x082c 
 
06-03 10:52:25.445 7149-7149/xxx I/dalvikvm: Could not find method android.content.ContextWrapper.getExternalFilesDirs, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.445 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 571: Landroid/content/ContextWrapper;.getExternalFilesDirs (Ljava/lang/String;)[Ljava/io/File; 
 
06-03 10:52:25.445 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0882 
 
06-03 10:52:25.445 7149-7149/xxx E/dalvikvm: Could not find class 'android.transition.TransitionManager', referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.445 7149-7149/xxx W/dalvikvm: VFY: unable to resolve check-cast 1829 (Landroid/transition/TransitionManager;) in Lyyy/MainActivity; 
 
06-03 10:52:25.445 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x1f at 0x093e 
 
06-03 10:52:25.445 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.onProvideReferrer, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.445 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 152: Landroid/app/Activity;.onProvideReferrer()Landroid/net/Uri; 
 
06-03 10:52:25.445 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x097e 
 
06-03 10:52:25.445 7149-7149/xxx I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/FragmentActivity;.doReallyStop (Z)V from Lyyy/MainActivity;) 
 
06-03 10:52:25.445 7149-7149/xxx I/dalvikvm: Could not find method android.support.v4.app.FragmentActivity.doReallyStop, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.445 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 2582: Landroid/support/v4/app/FragmentActivity;.doReallyStop (Z)V 
 
06-03 10:52:25.445 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x09ab 
 
06-03 10:52:25.450 7149-7149/xxx I/dalvikvm: Could not find method android.content.Context.getDrawable, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.450 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 496: Landroid/content/Context;.getDrawable (I)Landroid/graphics/drawable/Drawable; 
 
06-03 10:52:25.450 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x09f5 
 
06-03 10:52:25.450 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.showLockTaskEscapeMessage, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.450 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 221: Landroid/app/Activity;.showLockTaskEscapeMessage()V 
 
06-03 10:52:25.450 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0a05 
 
06-03 10:52:25.450 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.getContentTransitionManager, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.450 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 66: Landroid/app/Activity;.getContentTransitionManager()Landroid/transition/TransitionManager; 
 
06-03 10:52:25.450 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0a0b 
 
06-03 10:52:25.450 7149-7149/xxx E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.450 7149-7149/xxx W/dalvikvm: VFY: unable to resolve check-cast 57 (Landroid/app/SharedElementCallback;) in Lyyy/MainActivity; 
 
06-03 10:52:25.450 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x1f at 0x0ac7 
 
06-03 10:52:25.450 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.getReferrer, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.450 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 80: Landroid/app/Activity;.getReferrer()Landroid/net/Uri; 
 
06-03 10:52:25.450 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0b3b 
 
06-03 10:52:25.455 7149-7149/xxx I/dalvikvm: Could not find method android.content.ContextWrapper.getSystemServiceName, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.455 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 585: Landroid/content/ContextWrapper;.getSystemServiceName (Ljava/lang/Class;)Ljava/lang/String; 
 
06-03 10:52:25.455 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0bb8 
 
06-03 10:52:25.455 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.isVoiceInteractionRoot, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.455 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 104: Landroid/app/Activity;.isVoiceInteractionRoot()Z 
 
06-03 10:52:25.455 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0be0 
 
06-03 10:52:25.455 7149-7149/xxx I/dalvikvm: Could not find method android.content.ContextWrapper.getExternalMediaDirs, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.455 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 572: Landroid/content/ContextWrapper;.getExternalMediaDirs()[Ljava/io/File; 
 
06-03 10:52:25.455 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0c68 
 
06-03 10:52:25.455 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.getMediaController, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.455 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 74: Landroid/app/Activity;.getMediaController()Landroid/media/session/MediaController; 
 
06-03 10:52:25.455 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0cac 
 
06-03 10:52:25.455 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.getSearchEvent, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.455 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 83: Landroid/app/Activity;.getSearchEvent()Landroid/view/SearchEvent; 
 
06-03 10:52:25.455 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0d2b 
 
06-03 10:52:25.455 7149-7149/xxx I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v4/app/FragmentActivity;.onReallyStop()V from Lyyy/MainActivity;) 
 
06-03 10:52:25.455 7149-7149/xxx I/dalvikvm: Could not find method android.support.v4.app.FragmentActivity.onReallyStop, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.455 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 2616: Landroid/support/v4/app/FragmentActivity;.onReallyStop()V 
 
06-03 10:52:25.455 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0d6b 
 
06-03 10:52:25.455 5258-5258/? D/AbsListView: onDetachedFromWindow 
 
06-03 10:52:25.455 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.isVoiceInteraction, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.455 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 103: Landroid/app/Activity;.isVoiceInteraction()Z 
 
06-03 10:52:25.455 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0ddb 
 
06-03 10:52:25.455 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.requestVisibleBehind, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.455 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 183: Landroid/app/Activity;.requestVisibleBehind (Z)Z 
 
06-03 10:52:25.455 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0e40 
 
06-03 10:52:25.455 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.shouldShowRequestPermissionRationale, referenced from method xxx.MainActivity.access$super 
 
06-03 10:52:25.455 7149-7149/xxx W/dalvikvm: VFY: unable to resolve virtual method 216: Landroid/app/Activity;.shouldShowRequestPermissionRationale (Ljava/lang/String;)Z 
 
06-03 10:52:25.455 7149-7149/xxx D/dalvikvm: VFY: replacing opcode 0x6f at 0x0e55 
 
06-03 10:52:25.455 7149-7149/xxx I/dalvikvm: Could not find method android.app.Activity.finishAndRemoveTask, referenced from method xxx.MainActivity.access$super

Was habe ich? Hauptaktivität - mit 7 Tasten, jede Taste hat ein Bild als Hintergrund. Alle Schaltflächen sind anklickbar, und beim Klicken auf jede Schaltfläche wird eine neue Aktivität gestartet. Wenn ich also auf die Schaltfläche 1 klicke, wird activity1 gestartet. Wenn du auf button2 klickst, wird activity2 gestartet und so weiter. Jede der neuen Aktivitäten, d. H. Activity1, activity2, ... activity7, hat auch ein Bild, das die App aus dem Mipmap-Ordner nimmt.

activity_main.xml

<?xml version="1.0" encoding="utf-8"?> 
 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
 
    xmlns:tools="http://schemas.android.com/tools" 
 
    xmlns:ads="http://schemas.android.com/apk/res-auto" 
 
    android:layout_width="match_parent" 
 
    android:layout_height="match_parent" 
 
    android:paddingBottom="@dimen/activity_vertical_margin" 
 
    android:paddingLeft="@dimen/activity_horizontal_margin" 
 
    android:paddingRight="@dimen/activity_horizontal_margin" 
 
    android:paddingTop="@dimen/activity_vertical_margin" 
 
    tools:context="xxx.MainActivity"> 
 

 
    <Button 
 
     android:layout_width="103dp" 
 
     android:layout_height="82dp" 
 
     android:id="@+id/btn_inside" 
 
     android:layout_below="@+id/LL_subheading1" 
 
     android:layout_centerHorizontal="true" 
 
     android:background="@mipmap/pic_small_inside" 
 
     style="@style/Widget.AppCompat.Button.Borderless" 
 
     android:clickable="true"/> 
 

 
    <Button 
 
     android:layout_width="103dp" 
 
     android:layout_height="82dp" 
 
     android:id="@+id/btn_on_the_side1" 
 
     android:layout_below="@+id/LL_subheading2" 
 
     android:layout_alignParentLeft="true" 
 
     android:layout_alignParentStart="true" 
 
     android:background="@mipmap/pic_small_on_the_side1" 
 
     style="@style/Base.Widget.AppCompat.Button.Borderless" 
 
     android:clickable="true"/> 
 

 
    <Button 
 
     android:layout_width="103dp" 
 
     android:layout_height="82dp" 
 
     android:id="@+id/btn_on_the_side3" 
 
     android:layout_below="@+id/LL_subheading2" 
 
     android:layout_alignParentRight="true" 
 
     android:layout_alignParentEnd="true" 
 
     android:background="@mipmap/pic_small_on_the_side3" 
 
     style="@style/Base.Widget.AppCompat.Button.Borderless" 
 
     android:clickable="true"/> 
 

 
    <Button 
 
     android:layout_width="103dp" 
 
     android:layout_height="82dp" 
 
     android:id="@+id/btn_on_the_side2" 
 
     android:layout_alignTop="@+id/btn_on_the_side1" 
 
     android:layout_centerHorizontal="true" 
 
     android:background="@mipmap/pic_small_on_the_side2" 
 
     style="@style/Base.Widget.AppCompat.Button.Borderless" 
 
     android:clickable="true"/> 
 

 
    
 

 
</RelativeLayout>

MainActivity.java

public class MainActivity extends AppCompatActivity { 
 

 
    private static Button btn1, btn2, btn3, btn4, btn5, btn6, btn7; 
 

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

 
    OnClickButtonListener(); 
 
    } 
 

 
    public void OnClickButtonListener() { 
 
    btn1 = (Button) findViewById(R.id.btn_1); 
 
    btn1.setOnClickListener(new View.OnClickListener() {@ 
 
     Override 
 
     public void onClick(View v) { 
 
     Intent intent_1 = new Intent(MainActivity.this, MainActivity_1.class); 
 
     startActivity(intent_1); 
 
     } 
 
    }); 
 

 

 
    btn2 = (Button) findViewById(R.id.btn_2); 
 
    btn2.setOnClickListener(new View.OnClickListener() {@ 
 
     Override 
 
     public void onClick(View v) { 
 
     Intent intent_2 = new Intent(MainActivity.this, MainActivity_2.class); 
 
     startActivity(intent_2); 
 
     } 
 
    }); 
 

 
    btn3 = (Button) findViewById(R.id.btn_3); 
 
    btn3.setOnClickListener(new View.OnClickListener() {@ 
 
     Override 
 
     public void onClick(View v) { 
 
     Intent intent_3 = new Intent(MainActivity.this, MainActivity_3.class); 
 
     startActivity(intent_3); 
 
     } 
 
    }); 
 

 
    btn4 = (Button) findViewById(R.id.btn_4); 
 
    btn4.setOnClickListener(new View.OnClickListener() {@ 
 
     Override 
 
     public void onClick(View v) { 
 
     Intent intent_4 = new Intent(MainActivity.this, MainActivity_4.class); 
 
     startActivity(intent_4); 
 
     } 
 
    }); 
 

 
    btn5 = (Button) findViewById(R.id.btn_5); 
 
    btn5.setOnClickListener(new View.OnClickListener() {@ 
 
     Override 
 
     public void onClick(View v) { 
 
     Intent intent_5 = new Intent(MainActivity.this, MainActivity_5.class); 
 
     startActivity(intent_5); 
 
     } 
 
    }); 
 

 
    btn6 = (Button) findViewById(R.id.btn_6); 
 
    btn6.setOnClickListener(new View.OnClickListener() {@ 
 
     Override 
 
     public void onClick(View v) { 
 
     Intent intent_6 = new Intent(MainActivity.this, MainActivity_6.class); 
 
     startActivity(intent_6); 
 
     } 
 
    }); 
 

 
    btn7 = (Button) findViewById(R.id.btn_7); 
 
    btn7.setOnClickListener(new View.OnClickListener() {@ 
 
     Override 
 
     public void onClick(View v) { 
 
     Intent intent_7 = new Intent(MainActivity.this, MainActivity_7.class); 
 
     startActivity(intent_7); 
 
     } 
 
    }); 
 
    } 
 
}

logcat

05 - 25 23: 43: 17.209 17042 - 17042 <XX> W/<YY> : threadid = 1: thread exiting with uncaught exception(group = 0x41e4e700) 
 
05 - 25 23: 43: 17.209 17042 - 17042 <XX> E/AndroidRuntime: FATAL EXCEPTION: main 
 
java.lang.OutOfMemoryError 
 
at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 
 
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java: 596) 
 
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java: 444) 
 
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java: 832) 
 
at android.content.res.Resources.loadDrawable(Resources.java: 2988) 
 
at android.content.res.TypedArray.getDrawable(TypedArray.java: 602) 
 
at android.view.View. <init> (View.java: 3563) 
 
at android.widget.TextView. <init> (TextView.java: 881) 
 
at android.widget.Button. <init> (Button.java: 108) 
 
at android.support.v7.widget.AppCompatButton. <init> (AppCompatButton.java: 62) 
 
at android.support.v7.widget.AppCompatButton. <init> (AppCompatButton.java: 58) 
 
at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java: 105) 
 
at android.support.v7.app.AppCompatDelegateImplV7.createView(AppCompatDelegateImplV7.java: 972) 
 
at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(AppCompatDelegateImplV7.java: 1030) 
 
at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java: 44) 
 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java: 690) 
 
at android.view.LayoutInflater.rInflate(LayoutInflater.java: 761) 
 
at android.view.LayoutInflater.inflate(LayoutInflater.java: 498) 
 
at android.view.LayoutInflater.inflate(LayoutInflater.java: 398) 
 
at android.view.LayoutInflater.inflate(LayoutInflater.java: 354) 
 
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java: 276) 
 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java: 136) 
 
at abcpqr.red.MainActivity_1.onCreate(MainActivity_1.java: 21) 
 
at android.app.Activity.performCreate(Activity.java: 5372) 
 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java: 1104) 
 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java: 2257) 
 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java: 2349) 
 
at android.app.ActivityThread.access$700(ActivityThread.java: 159) 
 
t android.app.ActivityThread$H.handleMessage(ActivityThread.java: 1316) 
 
at android.os.Handler.dispatchMessage(Handler.java: 99) 
 
at android.os.Looper.loop(Looper.java: 176) 
 
at android.app.ActivityThread.main(ActivityThread.java: 5419) 
 
at java.lang.reflect.Method.invokeNative(Native Method) 
 
at java.lang.reflect.Method.invoke(Method.java: 525) 
 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java: 1046) 
 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java: 862) 
 
at dalvik.system.NativeStart.main(Native Method) 
 
05 - 25 23: 43: 25.074 17042 - 17042 <XX> I/Process: Sending signal.PID: 17042 SIG: 9

Was ist mein Problem? Ich habe den Fehler von überschüssigem Speicher.

Grafische Darstellung meines Problems Bitte beachten Sie das Bild unten: enter image description here

Bitte jemand mir helfen könnte? Gibt es einen besseren Weg, sich einem solchen Problem zu nähern?

Jede Hilfe wird sehr geschätzt. Vielen Dank!

+1

Bitte fügen Sie den eigentlichen Code für Ihre 'MainActivity' ein, und fügen Sie auch das vollständige Fehlerprotokoll ein, damit wir es untersuchen können. – ishmaelMakitla

+0

Ich hatte ein ähnliches Problem beim Erstellen einer App, behoben durch Festlegen der Ressource Zeichen = Null auf alle Bilder beim Schließen.Dann, wenn onResume die Ressourcen neu laden. Oder ein alternatives Verfahren, vielleicht ist es besser, Fragmente dafür zu verwenden, würde Sie mit den Speicherproblemen speichern, die Sie haben. – Geoff

+0

@ishmaelMakitla - danke - ich habe XML und Java der Hauptaktivität und auch Logcat hinzugefügt. –

Antwort

2

1) Stellen Sie sicher, dass Ihre Bilder die beste Größe für die höchste Dichte haben, auf der sie angezeigt werden. (Wenn es sich um riesige Bilder handelt, die komprimiert werden, nehmen sie viel zusätzlichen Speicher auf).

2) Ändern Sie alle Ihre Tasten ImageButtons, dann nach Speicher räumen während der Aktivität onStop():

@Override 
    protected void onStop(){ 
     // This controls the images and makes sure 
     // they're not using memory once the activity is closed 
     Drawable d = imageButton1.getDrawable(); 
     if (d != null) d.setCallback(null); 
     imageButton1.setImageDrawable(null); 
    } 

Denken Sie daran, dass, wenn Sie die Aktivität neu laden wollen, müssen Sie Ihre Image src neu deklarieren müssen .

@Override 
    protected void onResume(){ 
     super.onResume(); 
     imageButton1.setImageResource(R.mipmap.pic_small_inside); 
    } 
+0

danke, ich könnte es schaffen, nur durch die Verringerung der Größe der Bilder zu arbeiten.Dank für die heads-up. –

+1

Ihr immer am besten aus Löschen Bilder, so dass Sie nicht überschüssigen Speicher verwenden, wenn es nicht benötigt wird. Dennoch ist die Antwort wie oben. Froh, dass es geholfen hat. – Geoff

+0

danke @Geoff - ich bekomme einige Warnungen - pl können Sie helfen? (beachte, dass ich neu bei Android bin und dies nur als Nebenhobby betreibe - aber ich bin wirklich fasziniert davon!). Mein neuer Logcat steht am Anfang meines ursprünglichen Posts. –