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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:03:02+00:00 2026-05-19T04:03:02+00:00

I am trying to implement a custom view, for which I want to be

  • 0

I am trying to implement a custom view, for which I want to be able to pass parameters via an XML layout file. The catch is these parameters will be more or less arbitrary; they will eventually be used as parameters to construct a URL (it’s not worthwhile to build and maintain a complete list of valid params).

As such, the method in ApiDemos sample code is not necessarily appropriate, given I do not know the names of the parameters.

What I have attempted to do is the following:

public Chart(Context context, AttributeSet attributes) {
    super(context, attributes);
    params = new HashMap<String, String>();

    for(int i = 0; i < attributes.getAttributeCount(); i++) 
        params.put(attributes.getAttributeName(i), attributes.getAttributeValue(i));
}

This may not be the best way to go about this.. but the main issue I have is how do I filter out android: attributes (ie. I don’t want android:layout_height, etc. to be in params)?

  • 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-05-19T04:03:03+00:00Added an answer on May 19, 2026 at 4:03 am

    Found a way to do this by using an overloaded version of getAttributeValue(). Still open for input if there is a better way to do this.

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

Sidebar

Related Questions

im trying to implement a custom error page, what i want to be able
I'm trying to implement a custom view in which the user can draw with
I want to implement scrolling(horizontal) on my custom view which i have set in
I'm trying to implement a custom tab bar which is scrollable and has paging
I am trying to implement Custom Error handling via Action Filter Attributes. My code
I'm trying to implement ViewPager to combine two view within one activity, in which
I'm trying to get some custom info to be seen in the file->properties view
I am trying to implement my Edit action methods with strongly typed view which
I'm trying to implement a DataGrid in ASP.NET, and want to achieve custom paging
I am trying to implement custom ObservableCollection Which will have current (selected) item property

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.