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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:26:40+00:00 2026-06-13T06:26:40+00:00

I am developing a simple android apllication and just completed the home screen. Now

  • 0

I am developing a simple android apllication and just completed the home screen. Now if the orientation of the screen changes more than two times, it is throwing the error and application is getting crashed abrubptly.

Here is my Java Class:

public class PasswordActivity extends Activity implements OnClickListener {
  Button login;  
  Button forgot;
  Button register;  

  private static final String PREFERENCES = "prefs";
  private static final String PREFERENCES_NAME = "pref_name"; 
  SharedPreferences settings;
  private Cursor c;

  @Override 
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main); 
      login=(Button)findViewById(R.id.login_login);
      login.setOnClickListener(this);
      register=(Button)findViewById(R.id.login_register);
      register.setOnClickListener(this);
     
  }
  public void onClick(View v) {
  } 
}

And this is my Xml Code:

<?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="wrap_content"
  android:orientation="vertical"    
  android:background="@drawable/listpic">

  <LinearLayout 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:paddingTop="5dp"
    android:paddingLeft="3dp"
    android:paddingRight="3dp">  

    <TextView 
     android:layout_width="fill_parent"
     android:layout_weight="0.75"
     android:layout_height="wrap_content"
     android:text="@string/login_user_name"
     android:textStyle="bold"/>

    <EditText 
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:layout_weight="0.25"
     android:id="@+id/login_user_name"
     android:inputType="text"/>
  </LinearLayout>

  <LinearLayout 
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:orientation="horizontal"
     android:paddingLeft="3dp"
     android:paddingRight="3dp">  

     <TextView 
      android:layout_width="fill_parent"
      android:layout_weight="0.75"
      android:layout_height="wrap_content"
      android:text="@string/login_password"
      android:textStyle="bold"/>

     <EditText 
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_weight="0.25"
      android:inputType="textPassword"
      android:id="@+id/login_password"/>
  </LinearLayout>

  <LinearLayout 
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:orientation="horizontal"
     android:paddingLeft="3dp"
     android:paddingRight="3dp">  

     <Button 
      style="@style/left_button"
      android:text="@string/login_submit"
      android:id="@+id/login_login"/>

     <Button 
       style="@style/right_button"
       android:id="@+id/login_register"
       android:text="@string/register"/>

  </LinearLayout>
</LinearLayout>

Log Cat Details:

10-21 12:05:59.982: D/dalvikvm(622): GC_EXTERNAL_ALLOC freed 774 objects / 56240 bytes in 61ms
10-21 12:06:15.031: D/dalvikvm(622): GC_EXTERNAL_ALLOC freed 737 objects / 30992 bytes in 59ms
10-21 12:06:18.022: E/dalvikvm-heap(622): 7596000-byte external allocation too large for this process.
10-21 12:06:18.022: E/GraphicsJNI(622): VM won't let us allocate 7596000 bytes
10-21 12:06:18.043: D/AndroidRuntime(622): Shutting down VM
10-21 12:06:18.043: W/dalvikvm(622): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
10-21 12:06:18.092: E/AndroidRuntime(622): FATAL EXCEPTION: main
10-21 12:06:18.092: E/AndroidRuntime(622): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ravi.password/com.ravi.password.PasswordActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.app.ActivityThread.main(ActivityThread.java:4627)
10-21 12:06:18.092: E/AndroidRuntime(622):  at java.lang.reflect.Method.invokeNative(Native Method)
10-21 12:06:18.092: E/AndroidRuntime(622):  at java.lang.reflect.Method.invoke(Method.java:521)
10-21 12:06:18.092: E/AndroidRuntime(622):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-21 12:06:18.092: E/AndroidRuntime(622):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-21 12:06:18.092: E/AndroidRuntime(622):  at dalvik.system.NativeStart.main(Native Method)
10-21 12:06:18.092: E/AndroidRuntime(622): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.view.LayoutInflater.createView(LayoutInflater.java:513)
10-21 12:06:18.092: E/AndroidRuntime(622):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
10-21 12:06:18.092: E/AndroidRuntime(622):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.app.Activity.setContentView(Activity.java:1647)
10-21 12:06:18.092: E/AndroidRuntime(622):  at com.ravi.password.PasswordActivity.onCreate(PasswordActivity.java:34)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
10-21 12:06:18.092: E/AndroidRuntime(622):  ... 12 more
10-21 12:06:18.092: E/AndroidRuntime(622): Caused by: java.lang.reflect.InvocationTargetException
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.widget.LinearLayout.<init>(LinearLayout.java:115)
10-21 12:06:18.092: E/AndroidRuntime(622):  at java.lang.reflect.Constructor.constructNative(Native Method)
10-21 12:06:18.092: E/AndroidRuntime(622):  at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.view.LayoutInflater.createView(LayoutInflater.java:500)
10-21 12:06:18.092: E/AndroidRuntime(622):  ... 22 more
10-21 12:06:18.092: E/AndroidRuntime(622): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.graphics.Bitmap.nativeCreate(Native Method)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.graphics.Bitmap.createBitmap(Bitmap.java:468)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.graphics.Bitmap.createBitmap(Bitmap.java:435)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:340)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.graphics.BitmapFactory.finishDecode(BitmapFactory.java:488)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:462)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:323)
10-21 12:06:18.092: E/AndroidRuntime(622):  at android.view.ViewGroup.<init>(ViewGroup.java:285)
10-21 12:06:18.092: E/AndroidRuntime(622):  ... 26 more 

Images used are of very small size around 5kb.

  • 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-13T06:26:42+00:00Added an answer on June 13, 2026 at 6:26 am

    At runtime, Android resize’s images based on need (based on the screen size and resolution). It uses Bitmap’s for doing the resizing internally. Which, obviously, is very memory intensive (kinda allocates memory like crazy). One quick way to fix such issues can be, that you copy all drawable files to drawable-ldpi, mdpi, hdpi folders. This way android will just pick up the files from these folders and not resize them.

    Its a random kind exception, a real pain to fix.

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

Sidebar

Related Questions

i am developing one simple application for android mobile here i am using two
I'm developing a simple Android application that would have an action bar on the
I'm developing a simple voice recognizer using the service offered by Android and reading
I am developing a simple sip-based voip app for android. I used this sample
I am using Android SDK 1.6 and developing some simple apps. It seems everytime
I am currently developing socket communication between android and server, which is a simple
I am developing a simple android application using eclipse. I wrote a JUnit TestCase
I just got started today developing for Android. I tried to make an application
I am developing a simple demo . Here in this demo, I am just
I am developing simple travel agent android application. When application starts it loads list

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.