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

  • Home
  • SEARCH
  • 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 9128783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:35:46+00:00 2026-06-17T07:35:46+00:00

EDIT 1/14/2013 – I tried redownloading the facebook SDK… Still the same error. I

  • 0

EDIT 1/14/2013 – I tried redownloading the facebook SDK… Still the same error.


I am getting android.view.InflateException caused by outOfMemoryException when calling facebook.authorize together with the looper.

This is a snippet of my code where the calling of facebook.authorize is being done:

public void promptLogin(){
    if (! facebook.isSessionValid()) {
        loginAndContinue();
    }
    else {
        Continue();
    }
}
public void loginAndContinue(){
    new Thread(new Runnable() {

        public void run() {
            // TODO Auto-generated method stub
            Looper.prepare();
            openLoginDialog();
            Looper.loop(); // This is line 248
        }
    }).start();
}
public void openLoginDialog(){
    facebook.authorize(this, PERMISSIONS, Facebook.FORCE_DIALOG_AUTH, new LoginDialogListener());
}
public void Continue(){
    AsyncFacebookRunner myAsyncRunner = new AsyncFacebookRunner(facebook);
    myAsyncRunner.request("me", new meRequestListener(this));
}

And here is the log error:

>     01-14 19:42:04.551: E/AndroidRuntime(890): FATAL EXCEPTION: Thread-105
>     01-14 19:42:04.551: E/AndroidRuntime(890): android.view.InflateException: Binary XML file line #107: Error
> inflating class <unknown>
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.view.LayoutInflater.createView(LayoutInflater.java:606)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at com.android.internal.app.AlertController.installContent(AlertController.java:240)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.app.AlertDialog.onCreate(AlertDialog.java:336)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.app.ProgressDialog.onCreate(ProgressDialog.java:198)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.app.Dialog.dispatchOnCreate(Dialog.java:353)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.app.Dialog.show(Dialog.java:257)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at com.facebook.widget.WebDialog$DialogWebViewClient.onPageStarted(WebDialog.java:364)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:267)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.os.Handler.dispatchMessage(Handler.java:99)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.os.Looper.loop(Looper.java:137)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at com.COMPANYNAME.framework.impl.AndroidGame$6.run(AndroidGame.java:248)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at java.lang.Thread.run(Thread.java:856)
>     01-14 19:42:04.551: E/AndroidRuntime(890): Caused by: java.lang.reflect.InvocationTargetException
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at java.lang.reflect.Constructor.constructNative(Native Method)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.view.LayoutInflater.createView(LayoutInflater.java:586)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    ... 20 more
>     01-14 19:42:04.551: E/AndroidRuntime(890): Caused by: java.lang.OutOfMemoryError
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:483)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:351)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:773)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.content.res.Resources.loadDrawable(Resources.java:1935)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.view.View.<init>(View.java:2785)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.view.ViewGroup.<init>(ViewGroup.java:385)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.widget.LinearLayout.<init>(LinearLayout.java:174)
>     01-14 19:42:04.551: E/AndroidRuntime(890):    at android.widget.LinearLayout.<init>(LinearLayout.java:170)

It worked like a charm before, but now, after adding a button (programmatically), it doesn’t work anymore.

Just if it helps you to help me, here is the code where I inflate a linearlayout where I store the facebook picture and textview for the name:

JAVA:

    setContentView(gameLayout);
    View.inflate(this, R.layout.facebook, gameLayout);
    facebookLayout = (LinearLayout)findViewById(R.id.facebookLayout);
    facebookName = (TextView)findViewById(R.id.facebookName);
    profilePicture = (ProfilePictureView)findViewById(R.id.profile_pic);
    profilePicture.setCropped(true);
    getNameAndId();
    facebookName.setText("Welcome, " + name + "!");
    showFacebook(false);
    checkState();
}

public void checkState() {
    if (! facebook.isSessionValid()) {
        facebookName.setVisibility(View.GONE);
        profilePicture.setVisibility(View.GONE);
    }
}

XML:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:facebook="http://schemas.android.com/apk/res-auto"
    android:id="@+id/facebookLayout"
    android:orientation="vertical"
    android:layout_width="match_parent" android:layout_height="match_parent"
    android:layout_gravity="center"
    android:padding="100dp"
    android:layout_alignParentTop="true">
    <com.facebook.widget.ProfilePictureView
        android:id="@+id/profile_pic"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        android:layout_gravity="center"
        android:gravity="center_horizontal"
        facebook:preset_size="small" />
    <TextView android:id="@+id/facebookName"
        android:text="Welcome!"
        android:textColor="#0000FF"
        android:padding="5dp"
        android:layout_width="wrap_content" android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        android:gravity="center"/>
</LinearLayout>

I hope you can help me, because I have no clue on how to proceed from here.

  • 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-17T07:35:47+00:00Added an answer on June 17, 2026 at 7:35 am

    I managed to get it working now! It seemed like I had too many images loaded into memory at the same time. I tried commenting out some of the big images and voila! It worked!

    The solution is that you’ll have to recycle the images when switching between screens where they are not needed. That way you’ll save up lots of memory and not have to face the same problem as I did.

    Do this when you do not need an image anymore:

        bitmap.recycle();
        bitmap = null;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Edit: Solved, the error dissapeared whe I updated the package. I'm getting an error
EDIT: See my answer below--> I am wanting to have a view that when
Edit 1/16/2013: Problem Resolved! Two days ago, I released an updated version of the
Edit: whilst back 2013 Jon Skeet's accepted answer was 100% correct. For anyone coming
Update 2013-04-25: This is a popular question that is getting more attention than it
EDIT: Updated thanks to @daroczig's lovely answer below. However, test 2 still feels like
Edit : Array should be CvMat or IplImage is not an error message specific
EDIT, April 2013: Old code no longer nedeed. Use Tumblr's new shortcodes for 'like'
2013 Edit: async and await now make this trivial! :-) I've got some code
EDIT 07/14 As Bill Burgess mentionned in a comment of his answer, this question

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.