ShowCaseView 메모리 부족 오류

티아고 루카스

Galaxy S 제품군에 문제가 있습니다. 쇼케이스보기는 다른 장치에서 완벽하게 작동하지만 Galaxy S 장치에서 다음 오류가 발생합니다.

java.lang.OutOfMemoryError: Failed to allocate a 5760012 byte allocation with 3573238 free bytes and 3MB until OOM at dalvik.system.VMRuntime.newNonMovableArray(VMRuntime.java) at android.graphics.BitmapFactory.nativeDecodeAsset(BitmapFactory.java)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:726)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:547)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:1014)
at android.content.res.Resources.loadDrawableForCookie(Resources.java:3747)
at android.content.res.Resources.loadDrawable(Resources.java:3620) at android.content.res.Resources.getDrawable(Resources.java:1852) at android.support.v4.content.res.ResourcesCompatApi21.getDrawable(ResourcesCompatApi21.java)
at android.support.v4.content.res.ResourcesCompat.getDrawable(ResourcesCompat.java)
at com.github.amlcurran.showcaseview.StandardShowcaseDrawer.(StandardShowcaseDrawer.java)
at com.github.amlcurran.showcaseview.ShowcaseView.(ShowcaseView.java)
at com.github.amlcurran.showcaseview.ShowcaseView.(ShowcaseView.java)
at com.github.amlcurran.showcaseview.ShowcaseView$Builder.(ShowcaseView.java)
at com.github.amlcurran.showcaseview.ShowcaseView$Builder.(ShowcaseView.java)
at br.com.mygas.myapplication.MainActivity.showcase(MainActivity.java)
at br.com.mygas.myapplication.MainActivity.access$300(MainActivity.java)
at br.com.mygas.myapplication.MainActivity$5.onShowcaseViewDidHide(MainActivity.java)
at com.github.amlcurran.showcaseview.ShowcaseView$2.onAnimationEnd(ShowcaseView.java)
at com.github.amlcurran.showcaseview.AnimatorAnimationFactory$2.onAnimationEnd(AnimatorAnimationFactory.java)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1089)
at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:666)
at android.animation.ValueAnimator$AnimationHandler.run(ValueAnimator.java:682)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
at android.view.Choreographer.doCallbacks(Choreographer.java:590) at
android.view.Choreographer.doFrame(Choreographer.java:559) at
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
at android.os.Handler.handleCallback(Handler.java:739) at
android.os.Handler.dispatchMessage(Handler.java:95) at
android.os.Looper.loop(Looper.java:145) at
android.app.ActivityThread.main(ActivityThread.java:5942) at
java.lang.reflect.Method.invoke(Method.java) at
java.lang.reflect.Method.invoke(Method.java:372) at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

그리고 이것은 위의 오류를 생성하는 구현 된 코드입니다.

private void showcase() {
        if (SaveSharedPreference.isMainActivity(this)) {
            switch (counter) {
                case 0:
                    new ShowcaseView.Builder(this)
                            .withMaterialShowcase()
                            .setContentTitle("Esta é a tela inicial:")
                            .setStyle(R.style.CustomShowcaseThemeNext)
                            .setShowcaseEventListener(new SimpleShowcaseEventListener() {
                                @Override
                                public void onShowcaseViewDidHide(ShowcaseView showcaseView) {
                                    counter++;
                                    showcase();
                                }
                            })
                            .build();
                    break;

                case 1:
                    new ShowcaseView.Builder(this)
                            .setContentTitle("Selecione o tipo de combustível:")
                            .setTarget(new ViewTarget(R.id.spinner, this))
                            .setShowcaseDrawer(new CustomShowcaseView(this, findViewById(R.id.spinner).getWidth(), findViewById(R.id.spinner).getHeight()))
                            .setShowcaseEventListener(new SimpleShowcaseEventListener() {
                                @Override
                                public void onShowcaseViewDidHide(ShowcaseView showcaseView) {
                                    counter++;
                                    showcase();
                                }
                            })
                            .build();
                    break;

                case 2:
                    new ShowcaseView.Builder(this)
                            .withMaterialShowcase()
                            .setTarget(new ViewTarget(R.id.fab2, this))
                            .setContentTitle("Clique neste botão para procurar combustível ao redor:")
                            .setStyle(R.style.CustomShowcaseThemeNext)
                            .setShowcaseEventListener(new SimpleShowcaseEventListener() {
                                @Override
                                public void onShowcaseViewDidHide(ShowcaseView showcaseView) {
                                    counter++;
                                    showcase();
                                }
                            })
                            .build();
                    break;

                case 3:
                    new ShowcaseView.Builder(this)
                            .withMaterialShowcase()
                            .setTarget(new ViewTarget(R.id.fab2, this))
                            .setContentTitle("Lembre-se:")
                            .setContentText("É necessário estar com o GPS ligado")
                            .setStyle(R.style.CustomShowcaseTheme2)
                            .setShowcaseEventListener(new SimpleShowcaseEventListener() {
                                @Override
                                public void onShowcaseViewDidHide(ShowcaseView showcaseView) {
                                    counter++;
                                    showcase();
                                }
                            })
                            .build();
                    SaveSharedPreference.mainActivityFirst(this);
                    break;
            }
        }
    }

오류가 어디에서 왔는지 알 수 없으므로 조언을 구합니다.

티아고 루카스

ShowcaseView.java에서 메서드 숨기기를 변경하면 문제가 해결되었습니다.

@Override
    public void hide() {
        // If the type is set to one-shot, store that it has shot
        shotStateStore.storeShot();
        mEventListener.onShowcaseViewHide(this);
        fadeOutShowcase();
    }

이에:

@Override
    public void hide() {
        // If the type is set to one-shot, store that it has shot
        clearBitmap();
        shotStateStore.storeShot();
        mEventListener.onShowcaseViewHide(this);
        fadeOutShowcase();
    }

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Fontconfig 오류- "메모리 부족"

분류에서Dev

Fontconfig 오류- "메모리 부족"

분류에서Dev

Fontconfig 오류- "메모리 부족"

분류에서Dev

ConnectionQueueStatsProvider의 메모리 부족 오류

분류에서Dev

Imageview의 Android 메모리 부족 오류

분류에서Dev

hadoop fs -ls 메모리 부족 오류

분류에서Dev

Android 메모리 부족 오류?

분류에서Dev

Android Studio의 메모리 부족 오류

분류에서Dev

Python Spark : Java 메모리 부족 오류

분류에서Dev

Android Studio 메모리 부족 오류 ViewFlipper

분류에서Dev

Spark GraphX 메모리 부족 오류

분류에서Dev

Chrome 오류 'Chrome 메모리 부족'

분류에서Dev

카메라 미리보기 메모리 부족 오류

분류에서Dev

MATLAB의 일대일 분류 및 메모리 부족 오류

분류에서Dev

MATLAB의 일대일 분류 및 메모리 부족 오류

분류에서Dev

Cassandra NodeTool 수리-메모리 부족 오류

분류에서Dev

OCaml의 소프트 메모리 부족 오류에서 복구

분류에서Dev

새로운 문제-런타임 오류-메모리 부족

분류에서Dev

Python + Selenium 첫로드시 메모리 부족 오류

분류에서Dev

Cholmod 오류 '메모리 부족': Seurat 개체 병합

분류에서Dev

자바 컬렉션 메모리 부족 오류

분류에서Dev

gridView Android Eclipse의 메모리 부족 오류

분류에서Dev

Mapreduce 셔플 단계의 메모리 부족 오류

분류에서Dev

메모리 부족 오류, Java 힙 공간

분류에서Dev

AnimationDrawable을 사용할 때 메모리 부족 오류

분류에서Dev

JSON to SSTable 도구 메모리 부족 오류

분류에서Dev

Mongodb 빌드 / 컴파일 오류 : Ubuntu에서 메모리 부족

분류에서Dev

Java 메모리 부족 어레이 오류

분류에서Dev

Fortify를 사용하는 PermGen 메모리 부족 오류

Related 관련 기사

뜨겁다태그

보관