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 7798329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:58:27+00:00 2026-06-01T23:58:27+00:00

I have written a small Android project that shows some (image)buttons. It works fine

  • 0

I have written a small Android project that shows some (image)buttons. It works fine on my phone ( Galaxy S ), but when I try to run it on emulator, it gives the following error:
Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget

Please note, first activity, has 8 image buttons, and it gives out of memory exception. When I remove 3 buttons, it works fine. Actually, it works fine as long as scrollView is inivisble and If I add those 3 removed buttons ( so, scrollView is going to be visible ), it gives out of memory error. I think, this “out of memory” exception is not related to the number of (image) buttons, but is related to background image. Here is my XML file:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/rootid"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >

    <FrameLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" >

        <ImageView
            android:id="@+id/image"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:scaleType="center"
            android:src="@drawable/backgrounmobile" />

        <ScrollView
            android:id="@+id/ScrollView01"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_gravity="left|top|bottom|right" >

            <LinearLayout
                xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/centerlayout"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="right|top|bottom"
                android:layout_marginBottom="10dip"
                android:layout_marginLeft="10dip"
                android:layout_marginRight="20dip"
                android:layout_marginTop="0dip"
                android:orientation="vertical" >

                <Button
                    android:id="@+id/divan"
                    android:layout_width="160dip"
                    android:layout_height="110dip"
                    android:layout_gravity="center|top"
                    android:background="@drawable/divanbtn" />

                <Button
                    android:id="@+id/boostan"
                    android:layout_width="160dip"
                    android:layout_height="110dip"
                    android:layout_gravity="center|top"
                    android:background="@drawable/boostanbtn" />

                <Button
                    android:id="@+id/mavaez"
                    android:layout_width="160dip"
                    android:layout_height="110dip"
                    android:layout_gravity="center|top"
                    android:background="@drawable/mavaezbtn" />

                <Button
                    android:id="@+id/hekayat"
                    android:layout_width="160dip"
                    android:layout_height="110dip"
                    android:layout_gravity="center|top"
                    android:background="@drawable/hekayatbtn" />

                <Button
                    android:id="@+id/saadiname"
                    android:layout_width="160dip"
                    android:layout_height="110dip"
                    android:layout_gravity="center|top"
                    android:background="@drawable/saadinamebtn" />

                <Button
                    android:id="@+id/settings"
                    android:layout_width="160dip"
                    android:layout_height="110dip"
                    android:layout_gravity="center|top"
                    android:background="@drawable/settingsbtn" />

                <Button
                    android:id="@+id/about"
                    android:layout_width="160dip"
                    android:layout_height="110dip"
                    android:layout_gravity="center|top"
                    android:background="@drawable/aboutbtn" />
            </LinearLayout>
        </ScrollView>
    </FrameLayout>

</LinearLayout>

Would you please help me?

  • 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-01T23:58:28+00:00Added an answer on June 1, 2026 at 11:58 pm

    Your running low on memory, and the best way to remedy that will be to use less memory, loading smaller images will help a great deal here, and googles android team have been kind enough to put up a short description on how to do this 🙂

    http://developer.android.com/training/displaying-bitmaps/load-bitmap.html

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

Sidebar

Related Questions

I have written a small android app that grabs some data and displays it
I have written a small 16-bit assembly program that writes some values in some
I have written a small chat app that uses mysql + php to facilitate
I have written a small app that puts my bluetooth in discoverable mode for
I have written a small plugin to change the text size but it doesn't
I have written a small makefile for a few simple C programs that compiles
I have written a small function, which uses ElementTree to parse xml file,but it
I have written a small XML validator, that takes in an XML file and
I have written a small Python application where I use PyGame for displaying some
I have written a small Android Demo to use TTS in different languages. I

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.