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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:44:46+00:00 2026-05-25T12:44:46+00:00

My TextSwitcher class extends view. How can I add it in to my main

  • 0

My TextSwitcher class extends view. How can I add it in to my main file and envoke methods in the class?

Ive tried:

addView(new TextSwitcher(this));

But no luck.

  • 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-25T12:44:47+00:00Added an answer on May 25, 2026 at 12:44 pm

    By “my main file”, you mean the main layout file? First, you can do that straight in the layout XML. The syntax is:

    <com.mypackage.TextSwitcher android:id="@+id/TheSwitcher" />
    

    and don’t forget width/height/weight/etc.

    Second, you can add it programmatically via addView(). Be careful to pick the right container object for that. And don’t forget to set its layout params, which must be compatible with the container (for objects in LinearLayout, you provide params as as instance of LinearLayoutParams, etc.).

    I recommend the first approach though. Layout params are not particularly code-friendly, especially if you want density-independent sizing.

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

Sidebar

Related Questions

what will i do to add this layout into main.xml . this class file
I am really stuck on this. I am trying to do a simple textswitcher
I've my main custom listactivity class that have a instance object of my custom
I implement TextWatcher in the Activity : public class Coordinate extends Activity implements TextWatcher
Trying to do the following: animTimeChange = AnimationUtils.loadAnimation(this, android.R.anim.slide_in_left); itemTime.startAnimation(animTimeChange); itemTime.setText(new text); but the
I'm trying to add a TextWatcher editbox.afterTextChanged listenering to my Main activity where I
I have a class that extends Activity and implements ViewFactory. I have found some
I can't manage to get my textSwitcher to be able to support superscript text.
How can I make a textwatcher count down from 250 to 0 during typing?
So I have a TextSwitcher that I want to update every second with the

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.