About 142,000 results
Open links in new tab
  1. How to add a button in android? - Stack Overflow

    Jul 19, 2012 · And then cast your button with Button Class and set ClickListener. Button button = (Button) findViewById(R.id.button_send); button.setOnClickListener(new …

  2. android - How to change the color of a button? - Stack Overflow

    Here is my code, to make different colors on button, and Linear, Constraint and Scroll Layout. First, you need to make a custom_button.xml on your drawable

  3. how to add button click event in android studio

    Nov 23, 2013 · package com.mani.smsdetect; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class …

  4. java - Android Button Onclick - Stack Overflow

    Do not mix layout with code by using android:onClick tag in your XML. Instead, move the click method to your class with OnClickListener method like: Button button = (Button) …

  5. android - How to add button tint programmatically - Stack Overflow

    Apr 22, 2015 · You could use. button.setBackgroundTintList(ColorStateList.valueOf(resources.getColor(R.id.blue_100))); But …

  6. android - How to Change a Button's Icon Programmatically

    You can use MaterialButton instead of Button. The correct declaration of material button is as: MaterialButton button = findViewById(R.id.your_material_button_id); By the above declaration …

  7. Android Material Design Button Styles - Stack Overflow

    Beside android.support.design.button.MaterialButton (which mentioned by Gabriele Mariotti), There is also another Button widget called com.google.android.material.button.MaterialButton …

  8. Android - Back button in the title bar - Stack Overflow

    Jan 27, 2013 · <activity android:name=".SearchActivity"> </activity> Then add the following three lines of code in between. <meta-data android:name="android.support.PARENT_ACTIVITY" …

  9. Adding a button for Android in Java code - Stack Overflow

    Jun 13, 2016 · This link gives a full tutorial on how to add widgets to your Android app using java code. So, here's a summary for your button thing: 1) You remove the setContentView(...) line …

  10. How to disable an Android button? - Stack Overflow

    Dec 8, 2010 · Button button = (Button) findviewById(R.id.button); To enable/disable the button, you can use either: button.setEnabled(false); button.setEnabled(true); Or: …

Refresh