About 542,000 results
Open links in new tab
  1. How to use a text as a Button in Android - Stack Overflow

    May 24, 2011 · Best way to use a Text as a Button is BINDING. First you need to enable binding: Go to. Now add the following snippet inside "android" viewBinding true. Now click on "SYNC NOW". This will enable binding. Now you have to create object of binding. if ID of your TextView is "textView", then you can use it as a button by using this command: @Override.

  2. Add buttons to your app | Views | Android Developers

    Oct 31, 2024 · Learn how to add components in Compose. A button consists of text or an icon, or both, that communicates what action occurs when the user taps it. Note: For a better UI and user experience, see the Material Design button documentation.

  3. How to change the text of a Button widget in Android?

    Oct 3, 2010 · Just be sure to add import android.widget.View; at the top of your java file. If you also add import android.widget.Button;, it can be shortened to: ((Button)findViewById(R.id.yourButtonName)).setText("New Text"); You can use the setText() method. Example:

  4. Create a button | Jetpack Compose | Android Developers

    Apr 16, 2025 · Buttons let the user trigger a defined action. There are five types of button: Solid background with contrasting text. For primary actions, such as "Submit" and "Save." The shadow effect emphasizes the button's importance. Background color varies to match the surface. For primary or significant actions.

  5. Button in Android - GeeksforGeeks

    Jan 23, 2025 · In Android applications, a Button is a user interface that is used to perform some action when clicked or tapped. It is a very common widget in Android and developers often use it. This article demonstrates how to create a button in Android Studio. Class Hierarchy of the Button Class in Kotlinkotlin

  6. How to set custom text for a button in Android? - Stack Overflow

    Feb 9, 2012 · android:text="@layout/active" Ideally, this should be: android:text="@string/myText" Of course myText should be in your strings.xml

  7. Kotlin Android Button – Text - Tutorial Kart

    In this tutorial, we will learn how to set or change the text in Android Button, with the help of example application. In this example project, we will change the Button text in layout file using android:text XML attribute. The following is a step by step process.

  8. Jetpack Compose: Button, Outlined Button, and Text Button in Android ...

    May 25, 2022 · In general, there are three types of Buttons provided by Material Design Component library for Jetpack Compose. 1. Button (): A normal and regular button. 2. OutlinedButton (): Transparent...

  9. How to create Text Button in Android Jetpack Compose

    Nov 19, 2022 · Let’s learn how to add a text button in Android using Jetpack Compose. The Text composable can be made clickable with the help of the Modifier. In this example, we are creating a text button with TextButton composable. The TextButton has useful parameters such as onClick, modifier, enabled, elevation, shape, border, colors, etc.

  10. Android Button With Image And Text Example - dev2qa

    We can even specify the location of the image relative to the text on the button, such as on top, bottom, left, and right to the text. This article will show you an example of how to add images and text both in the android button.

  11. Some results have been removed