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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:41:02+00:00 2026-06-15T12:41:02+00:00

I’m trying to build a widget that is composed of a few controls grouped

  • 0

I’m trying to build a widget that is composed of a few controls grouped together. Here’s the widget:

public class VarioView extends RelativeLayout {

private int value;
private ImageView m_circle;
private TextView m_varioText;
private TextView m_units;
public VarioView(Context context)
{
    this(context,null);
}
public VarioView(Context context, AttributeSet attr)
{
    this(context,attr, 0);
}
public VarioView(Context context, AttributeSet attr, int defStyle)
{
    super(context, attr, defStyle);
    //View.inflate(context, R.layout.vario, this);
    LayoutInflater li = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    li.inflate(R.layout.vario, this, true);

    m_circle = (ImageView)this.findViewById(R.id.VarioCircle);
    m_varioText = (TextView)this.findViewById(R.id.VarioText);

    //m_circle.setColorFilter(Color.BLUE);
}
public int getValue() {
    return value;
}
public void setValue(int value) {
    m_varioText.setText(Integer.valueOf(value).toString());
    this.value = value;
}
}

Here’s the widget xml

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

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/VarioCircle"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_centerInParent="true"
        android:contentDescription="Vario Circle"
        android:src="@drawable/circle3" />

    <TextView
        android:id="@+id/VarioText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="200"
        android:textColor="#FF0000"
        android:textSize="60sp"
        android:textStyle="bold"
        android:typeface="monospace" />

    <TextView
        android:id="@+id/VarioUnits"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/VarioText"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="100dp"
        android:text="fpm"
        android:textSize="20sp" />
</RelativeLayout>

</merge>

Here’s circle shape:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval"
    android:useLevel="false"
    android:color="#FF0000" >

    <size
    android:height="200dip"
    android:width="200dip" />

    <stroke
    android:width="10dp"
    android:color="#FF0000" />

</shape>

And in my main view I’m just using it like this:

 <com.proflite.VarioView

         android:layout_width="match_parent"
    android:layout_height="match_parent"
 />

My problem is that it works fine when I run it in emulator (or real device), but when I try to go to graphical editor in Eclipse it draws a grey box over the control and gives me this:

The following classes could not be instantiated:
- com.proflite.VarioView (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse

android.content.res.Resources$NotFoundException: Could not resolve resource value: 0x7F030001.
    at android.content.res.BridgeResources.throwException(BridgeResources.java:693)
    at android.content.res.BridgeResources.getLayout(BridgeResources.java:271)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:394)
    at com.proflite.VarioView.<init>(VarioView.java:30)
    at com.proflite.VarioView.<init>(VarioView.java:23)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(    at sun.reflect.NativeConstructorAccessorImpl.newInstance(    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(    at java.lang.reflect.Constructor.newInstance(    at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:413)
    at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:170)
    at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135)
    at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:746)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:718)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:372)

Extra info, I check 0x7F030001 is mapped to R.layout.vario and the error is coming out of this line: li.inflate(R.layout.vario, this, true);. Additionally if I change it to li.inflate(R.layout.vario, this); it doesn’t give the error, but the control just shows “blank”, doesn’t render in editmode (still works when actually run).

I would REALLY like to be able to visualize the layout in the editor cuz it takes a long time to make minor layout alterations and rerun them in emulator.

Thanks

** Note ** the error comes from the layout where the control is placed. It actually renders successfully if I do graphical edit on the control itself.

  • 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-15T12:41:04+00:00Added an answer on June 15, 2026 at 12:41 pm

    Well, I feel pretty stupid. Everything worked after I restarted Eclipse.

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

Sidebar

Related Questions

I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace

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.