Questions tagged [android-button]

questions about the android.widget.Button element. This element can be used on activities.

On Android, buttons can be generated programmatically in Java code or by using xml layouts. Usually a listener(OnClickListener) is set on the Button to receive an event when the user touches the Button. The listener can be set in code or by using the android:onClick attribute in the xml layout, setting it to point to a method written in the Activity class.

Initial help

2399 questions
0
votes
2 answers

How to anchor simple button to snackbar

I have button instead of floating action button i want to anchor it with snack bar as it anchor with floating action bar like floating action button moves up when snack bar is shown, with floating action bar we do it like this: Snackbar.make(fab, s,…
0
votes
1 answer

Android Extended Button detect onClick

I have extended the Button class and not implemented onClick in extended button. And I am using the extended button every where and setting the onClick listener in each activity. How can I detect the button is clicked in the Extended class. public…
Prashant Jha
  • 574
  • 6
  • 21
0
votes
4 answers

how can i create EditText like instagram with send button inside EditText

how can I create EditText like Instagram's chat activity? EditText with send button inside in it. i tried to create that using ImageButton but it doesn't work quite well as the Text goes under image whenever i type. and if set limit of words per…
0
votes
1 answer

Cannot resolve symbol error in while change text on Text view by button in Android Studio

Help me I'm trying to develop app for Sudoku Im stuck at this Im just Bsc First yr guy don't know anything Here My Xml code for my TextView Code
Gokul GK
  • 11
  • 3
0
votes
1 answer

RecyclerView not displaying custom Button

I have created a custom subclass of AppCompatButton called SquareButton, which forces a button to be square. The code for that subclass was found here: https://stackoverflow.com/a/36991823/7648952. This button works fine and displays when the layout…
sbearben
  • 323
  • 6
  • 16
0
votes
1 answer

getTag and setTag with button

If you allow, my friends. I am still new in the world of the Android. I am looking for the code of the basket button in the picture. I have 4 activities. I want to collect the data entered in each activity through button send to the basket and store…
0
votes
2 answers

Can not add ripple effect on TextView using foreground selectableItemBackground

I tried to add ripple effect on my TextView used as button which has dark background. I already tried android:foreground="?attr/selectableItemBackground" on TextView android:theme="@style/Base.ThemeOverlay.AppCompat.Dark" on TextView parent…
Khemraj Sharma
  • 57,232
  • 27
  • 203
  • 212
0
votes
4 answers

Button not disappearing with setVisibility(View.GONE)

I am displaying a go to top button on scroll up on a RecyclerView. If user scrolls up the button is displayed. Here is the xml code which is nested in a RelativeLayout.
0
votes
0 answers

How to listen to button click from other activity?

I have 2 activity. 1.activity layout-> one.xml 2.activity layout-> two.xml There is a button in one.xml I want to add set on click function in 2.activity But it gives error E/AndroidRuntime: FATAL EXCEPTION: main Process:…
CompEng
  • 7,161
  • 16
  • 68
  • 122
0
votes
2 answers

Button with multi line text is little bit shifted below in android studio

I want to multi line text on a button but multi lining make it little bit shift down How to fix it? Here is XML code of Button:-
user6527938
0
votes
1 answer

Adding custom icon in rounded button

How to add custom icon on rounded button? This is button:
0
votes
2 answers

Change color of cardview/button on click Android

I would like the background colour to change to red on the StartStop CardView. It is currently green. How do I do this? Unfortunately StartStopCard.setCardBackgroundColor(Color.parseColor("#b70505")); will not work. I have attached my whole code…
0
votes
1 answer

Autoclick saveButton in every change of string in editText

Receive SMS then set EditText to msgBody public class SmsBroadcastReceiver extends BroadcastReceiver { //..... ((EditText)MainActivity.mThis.findViewById(R.id.editTextName)).setText(msgBody);} The error is this in View cannot be applied to…
0
votes
1 answer

Nested Scroll View Android Studio

How can i achieve this design (the yellow arrow) ? and (the orange arrow) ? is it a listview ? Thanks in advance!
0
votes
1 answer

button fails to launch the new activity instead it goes back to launcher activity- android a

Hellow everyone ... I'm new to Android Application development .. Currently I'm working with BITalino Android API to develop my own Biosignal App. The issue I'm facing now when I press the start button ... which intended to move to the next Activity…
TKim
  • 13
  • 5
1 2 3
99
100