Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7724139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:37:04+00:00 2026-06-01T04:37:04+00:00

I thought what I wanted would be pretty simple, but there must be something

  • 0

I thought what I wanted would be pretty simple, but there must be something I’m missing…

I setup a ViewPager with no problems. It horizontally slides between different fragments. However, when I try to add a header (or anything else) to my layout it force closes. How do I do this?

Here is the XML layout:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/background_light"
    android:padding="0dp">

<!-- ***** HEADER ***** -->

    <RelativeLayout  android:id="@+id/header"
        android:layout_width="fill_parent"
        android:layout_height="40dp"
        android:layout_marginTop="0dp"
        android:background="@drawable/background_dark"
        android:padding="0dp">

        <ImageView android:id="@+id/logo"
            android:contentDescription="@string/logo_contentDescription"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentBottom="true"
            android:layout_marginLeft="5sp"
            android:src="@drawable/logo" />

    </RelativeLayout>

<!-- ***** SLIDER ***** -->

    <android.support.v4.view.ViewPager
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:id="@+id/main_pager_view">

        <android.support.v4.view.PagerTitleStrip
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="top"
            android:layout_weight="1" />

    </android.support.v4.view.ViewPager>

</LinearLayout>

Here is my logcat:

03-28 19:31:30.447: D/dalvikvm(1023): GC_FOR_ALLOC freed 40K, 3% free 9068K/9347K, paused 74ms
03-28 19:31:30.646: I/dalvikvm-heap(1023): Grow heap (frag case) to 25.721MB for 17613052-byte allocation
03-28 19:31:30.844: D/dalvikvm(1023): GC_CONCURRENT freed <1K, 2% free 26267K/26567K, paused 20ms+19ms
03-28 19:31:33.524: D/dalvikvm(1023): GC_FOR_ALLOC freed 0K, 2% free 26267K/26567K, paused 45ms
03-28 19:31:33.524: I/dalvikvm-heap(1023): Forcing collection of SoftReferences for 39642008-byte allocation
03-28 19:31:33.604: D/dalvikvm(1023): GC_BEFORE_OOM freed 9K, 2% free 26258K/26567K, paused 81ms
03-28 19:31:33.604: E/dalvikvm-heap(1023): Out of memory on a 39642008-byte allocation.
03-28 19:31:33.614: I/dalvikvm(1023): "main" prio=5 tid=1 RUNNABLE
03-28 19:31:33.614: I/dalvikvm(1023):   | group="main" sCount=0 dsCount=0 obj=0x409c1460 self=0x12810
03-28 19:31:33.614: I/dalvikvm(1023):   | sysTid=1023 nice=0 sched=0/0 cgrp=default handle=1074082952
03-28 19:31:33.614: I/dalvikvm(1023):   | schedstat=( 3201691068 885739274 101 ) utm=284 stm=36 core=0
03-28 19:31:33.614: I/dalvikvm(1023):   at android.graphics.Bitmap.nativeCreate(Native Method)
03-28 19:31:33.624: I/dalvikvm(1023):   at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
03-28 19:31:33.624: I/dalvikvm(1023):   at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
03-28 19:31:33.624: I/dalvikvm(1023):   at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
03-28 19:31:33.624: I/dalvikvm(1023):   at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524)
03-28 19:31:33.624: I/dalvikvm(1023):   at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499)
03-28 19:31:33.624: I/dalvikvm(1023):   at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
03-28 19:31:33.624: I/dalvikvm(1023):   at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:773)
03-28 19:31:33.624: I/dalvikvm(1023):   at android.content.res.Resources.loadDrawable(Resources.java:1937)
03-28 19:31:33.624: I/dalvikvm(1023):   at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
03-28 19:31:33.624: I/dalvikvm(1023):   at android.view.View.<init>(View.java:2785)
03-28 19:31:33.624: I/dalvikvm(1023):   at android.view.ViewGroup.<init>(ViewGroup.java:385)
03-28 19:31:33.624: I/dalvikvm(1023):   at android.widget.LinearLayout.<init>(LinearLayout.java:174)
03-28 19:31:33.634: I/dalvikvm(1023):   at android.widget.LinearLayout.<init>(LinearLayout.java:170)
03-28 19:31:33.634: I/dalvikvm(1023):   at java.lang.reflect.Constructor.constructNative(Native Method)
03-28 19:31:33.634: I/dalvikvm(1023):   at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
03-28 19:31:33.634: I/dalvikvm(1023):   at android.view.LayoutInflater.createView(LayoutInflater.java:586)
03-28 19:31:33.634: I/dalvikvm(1023):   at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
03-28 19:31:33.634: I/dalvikvm(1023):   at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
03-28 19:31:33.645: I/dalvikvm(1023):   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
03-28 19:31:33.645: I/dalvikvm(1023):   at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
03-28 19:31:33.645: I/dalvikvm(1023):   at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-28 19:31:33.645: I/dalvikvm(1023):   at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
03-28 19:31:33.645: I/dalvikvm(1023):   at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
03-28 19:31:33.645: I/dalvikvm(1023):   at android.app.Activity.setContentView(Activity.java:1835)
03-28 19:31:33.645: I/dalvikvm(1023):   at com.mojackllc.postr.MainPagerActivity.onCreate(MainPagerActivity.java:20)
03-28 19:31:33.645: I/dalvikvm(1023):   at android.app.Activity.performCreate(Activity.java:4465)
03-28 19:31:33.645: I/dalvikvm(1023):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
03-28 19:31:33.645: I/dalvikvm(1023):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
03-28 19:31:33.645: I/dalvikvm(1023):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
03-28 19:31:33.645: I/dalvikvm(1023):   at android.app.ActivityThread.access$600(ActivityThread.java:123)
03-28 19:31:33.645: I/dalvikvm(1023):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
03-28 19:31:33.645: I/dalvikvm(1023):   at android.os.Handler.dispatchMessage(Handler.java:99)
03-28 19:31:33.645: I/dalvikvm(1023):   at android.os.Looper.loop(Looper.java:137)
03-28 19:31:33.645: I/dalvikvm(1023):   at android.app.ActivityThread.main(ActivityThread.java:4424)
03-28 19:31:33.645: I/dalvikvm(1023):   at java.lang.reflect.Method.invokeNative(Native Method)
03-28 19:31:33.645: I/dalvikvm(1023):   at java.lang.reflect.Method.invoke(Method.java:511)
03-28 19:31:33.645: I/dalvikvm(1023):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-28 19:31:33.645: I/dalvikvm(1023):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-28 19:31:33.645: I/dalvikvm(1023):   at dalvik.system.NativeStart.main(Native Method)
03-28 19:31:33.654: D/AndroidRuntime(1023): Shutting down VM
03-28 19:31:33.654: W/dalvikvm(1023): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
03-28 19:31:33.754: E/AndroidRuntime(1023): FATAL EXCEPTION: main
03-28 19:31:33.754: E/AndroidRuntime(1023): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mojackllc.postr/com.mojackllc.postr.MainPagerActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.app.ActivityThread.access$600(ActivityThread.java:123)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.os.Handler.dispatchMessage(Handler.java:99)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.os.Looper.loop(Looper.java:137)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.app.ActivityThread.main(ActivityThread.java:4424)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at java.lang.reflect.Method.invokeNative(Native Method)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at java.lang.reflect.Method.invoke(Method.java:511)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at dalvik.system.NativeStart.main(Native Method)
03-28 19:31:33.754: E/AndroidRuntime(1023): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.view.LayoutInflater.createView(LayoutInflater.java:606)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.app.Activity.setContentView(Activity.java:1835)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at com.mojackllc.postr.MainPagerActivity.onCreate(MainPagerActivity.java:20)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.app.Activity.performCreate(Activity.java:4465)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
03-28 19:31:33.754: E/AndroidRuntime(1023):     ... 11 more
03-28 19:31:33.754: E/AndroidRuntime(1023): Caused by: java.lang.reflect.InvocationTargetException
03-28 19:31:33.754: E/AndroidRuntime(1023):     at java.lang.reflect.Constructor.constructNative(Native Method)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.view.LayoutInflater.createView(LayoutInflater.java:586)
03-28 19:31:33.754: E/AndroidRuntime(1023):     ... 23 more
03-28 19:31:33.754: E/AndroidRuntime(1023): Caused by: java.lang.OutOfMemoryError
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.graphics.Bitmap.nativeCreate(Native Method)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.graphics.Bitmap.createBitmap(Bitmap.java:605)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.graphics.Bitmap.createBitmap(Bitmap.java:551)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:437)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:524)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:499)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:773)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.content.res.Resources.loadDrawable(Resources.java:1937)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.view.View.<init>(View.java:2785)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.view.ViewGroup.<init>(ViewGroup.java:385)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.widget.LinearLayout.<init>(LinearLayout.java:174)
03-28 19:31:33.754: E/AndroidRuntime(1023):     at android.widget.LinearLayout.<init>(LinearLayout.java:170)
03-28 19:31:33.754: E/AndroidRuntime(1023):     ... 26 more
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T04:37:05+00:00Added an answer on June 1, 2026 at 4:37 am

    Apparently your image is gigantic:

    Out of memory on a 39642008-byte allocation.

    That’s 37.8MB. You’re running out of memory.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was experimenting with mod-rewrite. I thought what I wanted was simple but I
I thought this would be fairly easy, but I'm totally baffled. I want one
Just out of curiosity i wanted to make something similar to what pretty much
I couldn't find another answer when I wanted this, so I thought I would
I wanted to create a Dictionary-like object and thought the correct way would be
My first thoughts are Erlang, or Java, but I wanted to know from others
Thought my range of search options would easily find this. I wish to combine
I thought I would rewrite this question (same iteration). The original was how to
I thought there was a way to quickly ask a NSSet to poll its
I thought the following line of code should work fine: $(.1).attr('href', '#Home'); Right? But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.