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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:29:12+00:00 2026-06-02T20:29:12+00:00

I am trying to inflate <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent android:layout_height=wrap_content> <Item android:id=@+id/ltArr

  • 0

I am trying to inflate

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content">
<Item  android:id="@+id/ltArr"
    android:layout_alignParentLeft="true"
    android:icon="@android:drawable/arrow_up_float"/>
<TextView android:id="@+id/ImText"
    android:layout_toRightOf="@id/ltArr"/>
<Item  android:layout_alignParentRight="true" 
    android:layout_toRightOf="@id/ImText"
     android:icon="@android:drawable/arrow_down_float"/>
</RelativeLayout>

In a procedure I am calling addTextView, and it is in a try catch block

try{
    addTextView("Showtext", intID, addtothisLayout);
    }catch (Exception ex){}

When inflating the layout above in the addText procedure there is a exception which is caught above, execution gets sent back to the catch in the calling procedure

void addTextView(String showTxt,integer id,  ViewGroup addtoparent)
{
View itemview = View.inflate(this, R.layout.itemlayout, addtoparent); //this causes the exception
..
..
}

Why when the exception is thrown can I not see anything in the ex variable?

Am I trying something silly ?

How do I see what the exception says? I have tried inspecting the exception ex variable as teh debugger passes over it but it does not have anything in it. If I was using a SQL in the procedure. I’d specifically throw SQLException and that would allow me to see the error description but here I dont know what to throw … ?

I’ve found reference to a resource not available exception in LogCat by removing the try catch clauses. But how do I catch those descriptions in the try ex var? Do I have to throw specific exceptions?

OK this is my answer, I was trying to inspect the declaration of the variable and needed to put something in the code block. “ex.toString()”

catch (Exception ex){
            ex.toString();
        }   

Thank all for the very prompt replies.

  • 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-02T20:29:13+00:00Added an answer on June 2, 2026 at 8:29 pm

    When I run it on an AVD 2.3.3 emulator I’m getting:

    04-28 22:03:36.537: E/AndroidRuntime(395): java.lang.RuntimeException: Unable to start  activity ComponentInfo{com.android.tests/com.android.tests.TestsActivity}: android.view.InflateException: Binary XML file line #5: Error inflating class Item
    

    That is, “Item” is not recognized as a view.

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

Sidebar

Related Questions

I am trying to make a reusable header. Here is my XML. <?xml version=1.0
I'm trying to create a custom Android compound view, here is the code: <?xml
I am trying to inflate more than one progress bar in a layout.Please tell
I am trying to inflate an ImageView that scales a Drawable that I can
I am trying to create options menu in my Android program. I am using
I am trying to enlarge my buttons height. I am trying to inflate the
I am a new android developer trying to write a simple contact book. When
I'm trying to inflate a FrameLayout in a GridView and I'm getting an exception.
I'm trying to inflate an custom alertdialog and encountered something strange. layout = inflater.inflate(R.layout.call_or_sms_dialog,(ViewGroup)findViewById(R.id.contacts));
Trying to inflate a Button code: LinearLayout ll = (LinearLayout)this.getLayoutInflater().inflate(R.layout.assets, null); Button btn =

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.