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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:48:40+00:00 2026-06-12T11:48:40+00:00

I have a slider that let’s me dynamically add a number of EditText fields.

  • 0

I have a slider that let’s me dynamically add a number of EditText fields.

This is the code I use:

EditText editText = new EditText(getActivity());
editText.setId(i);
editText.setLayoutParams(new LayoutParams(
LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
editText.setInputType(4096);
linearLayout.addView(editText);
editText.setHint("Cash Flow " + i);
i++;

This is in a while loop that makes sure the number of fields created = number on the slider. Anyways, the setInputType according to this doesn’t work for all values. For example, if I put 2 in it, it will automatically have the keyboard only as the “number&signs” portion.

However, I need the person to be able to enter negative numbers (i.e. a negative sign before the number).

I figured TYPE_NUMBER_FLAG_SIGNED with the ID 4096 should do the trick, but I can still enter letters and stuff in the field…

What is wrong?

  • 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-12T11:48:41+00:00Added an answer on June 12, 2026 at 11:48 am

    The TYPE_NUMBER_FLAG_SIGNED is a flag and not a input type,what you must do is write it like this:

    setInputType(TYPE_CLASS_NUMBER | TYPE_NUMBER_FLAG_SIGNED);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this complicated slider that utilizes tons of animation. I'm trying to find
I have this menu structure that is used to navigate through content slider panels.
First let me say that I have been working on this issue for about
Let's say I have a slider that can go between 0 and 1. The
I have a slider that has a fade-in and fade-out transition. It basically cycles
I have a slider that returns values from 0.0f to 1.0f. I want to
I have a StackPanel inside of a ScrollViewer. I have a slider that does
I have an SVG slider that I've been working on ... please see it
I have Slider in my app that is connected to a few methods. In
I have a jquery UI Slider that goes from 0 to 100 and default

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.