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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:25:42+00:00 2026-06-15T20:25:42+00:00

I want to create a panel from Misc widgets for Android platform at runtime.

  • 0

I want to create a panel from Misc widgets for Android platform at runtime.

 XmlPullParser parser = getResources().getXml(R.xml.panel_attribute);
 AttributeSet attributes = Xml.asAttributeSet(parser);
 Panel panel = (Panel) new Panel(getActivity(),attributes);

What should be the panel_attribute.xml ?

The panel should look like this

<org.miscwidgets.widget.Panel
    xmlns:panel="http://schemas.android.com/apk/res/org.miscwidgets"
    android:id="@+id/topPanel"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="4dip"
    panel:animationDuration="1000"
    panel:closedHandle="@drawable/sliding_drawer_handle_minimized"
    panel:content="@+id/searchparams_layout"
    panel:handle="@+id/handle"
    panel:linearFlying="true"
    panel:openedHandle="@drawable/sliding_drawer_handle_minimized"
    panel:position="top" />
  • 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-15T20:25:43+00:00Added an answer on June 15, 2026 at 8:25 pm

    First of all you must define the xml properties in a single file .xml inside the xml folder (subfolder of the resources folder) similarly as you would inside a layout file.

    <?xml version="1.0" encoding="utf-8"?>
    <ImageView xmlns:android="http://schemas.android.com/apk/res/android"
        android:contentDescription="@string/no_descr"
        android:src="@drawable/dummy"/>
    

    Secondly retrieving the attribute set is not as easy as two lines of code. You’ll need the following function written in Scala. Sorry I am a Scala guy but if you are stuck with java then you can easily convert it!

    def getAttributeSetFromXml(xmlId: Int, tagName: String, resources: Resources): AttributeSet = {
    /**
     * The good thing for being an internal function is that we don't need to pass tagName as a ref
     */
    def getAttributeSet(xmlPullParser: XmlPullParser /*, tagName: String*/): AttributeSet = {
      val state = xmlPullParser.next();
      if (state == XmlPullParser.START_TAG &&
        (xmlPullParser.getName contains tagName)) {
        Xml.asAttributeSet(xmlPullParser);
      }
      else {
        if (state == XmlPullParser.END_DOCUMENT) null;
        else getAttributeSet(xmlPullParser /*, tagName*/);
      }
    }
    
    getAttributeSet(resources.getXml(xmlId) /*, tagName*/);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to implement video panel in android in which i want to create
I want to create orders manually from virtue mart admin panel.Suppose one client call
I want to create a tree panel in sencha touch, but I am unable
I want to create a new Menu in the admin panel of Wordpress for
I want to change the control panel icon when I create a setup in
i want create multiple search where statement $where_search is a multiple condition from post
i want create a custom json data from the mssql 2008 results so that
I'm used from windows forms, that I create a panel, place controls inside it
I want to create a number of masked edit extenders from codebehind. Something like:
I want to create a list of classes, from where I can build a

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.