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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:21:45+00:00 2026-05-26T04:21:45+00:00

I have a library project, which is a TabActivity, and redefined some styles to

  • 0

I have a library project, which is a TabActivity, and redefined some styles to draw my custom ToggleButton with a different background.
I added a styles.xml file:

     <resources>
         <style name="custom_button" parent="@android:style/Widget.Button">
             <item name="android:gravity">center_vertical|center_horizontal</item>
             <item name="android:textColor">#FFFFFFFF</item>
             <item name="android:shadowColor">#FF000000</item>
             <item name="android:shadowDx">0</item>
             <item name="android:shadowDy">-1</item>
             <item name="android:shadowRadius">0.2</item>
             <item name="android:textSize">16dip</item>
             <item name="android:textStyle">bold</item>
             <item name="android:background">@drawable/btn_custom</item>
             <item name="android:focusable">true</item>
             <item name="android:clickable">true</item>
         </style>
     </resources>

And a themes.xml file:

<resources>
    <style name="custom_theme" parent="android:style/Theme.NoTitleBar">
        <item name="android:buttonStyleToggle">@style/custom_button</item>
    </style>
</resources>

And applied the theme in the manifest file.

Everything works ok if I start the activity directly instead of being a library project. But if I launch this activity (using an intent) from another project, the custom theme is not applied to the toggle buttons, they look like the default android theme.
Other resources are loaded, the library project has some drawables and they are painted ok.
I’m not using assets.

Other weird thing is that if I change the button text:

ToggleButton tbLocal = (ToggleButton)findViewById(R.id.tblocal);
tbLocal.setText("Local");

… when the activity is started, text is not changed and the default text (YES/NO) is used.
If I start the library project activity directly this doesn’t happen neither.

What can be 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-05-26T04:21:45+00:00Added an answer on May 26, 2026 at 4:21 am

    You have two manifest files: one in your library project and another in your application project. You need to apply your theme in the application AndroidManifest.xml file, and not in the library one (actually it is useless to define <activity> element in the library project manifest).

    For toggle button on/off text use the following:

    ToggleButton tbLocal = (ToggleButton)findViewById(R.id.tblocal);
    tbLocal.setTextOn("LocalOn");
    tbLocal.setTextOff("LocalOff");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class library project which contains some content files configured with the
I am creating a Control Library project. I have some Cursor files which i
I have a Class Library project which houses some shared code between other projects
A bit of background: I have a library project A, which contains a lot
I have a project which uses C++/CLI to implement a GUI and some background
I have a project which uses a large library residing in its own repository.
I have written a Flex Library project - a .swc file - which is
I have a class, which is part of a code library project that was
I have a Windows Forms project in Visual Studio 2008, which references a library
I have a class library project which uses a namespace (e.g., Cosmos.Creator.Util). I then

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.