- 0
[Java / Android] OnClick event, get the sender ID / tag
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By TRS-80 · Posted
ISTM from the article that the user was just out to get the developer for one reason or another. It may have had nothing to do with the software but the user just wanted to harm the developer in one way or another for some personal reason. They used the the project's Codeberg page to accomplish their goal. -
By yodat · Posted
""Settings vs. Control Panel" - this has absolutely been fixed." - This is absolutely not fixed. Your personal experience may vary but still there is a clear division between two. "Error 0x80070643" - this issue never existed for Windows 11: https://learn.microsoft.com/en...(install-error-0x80070643). You can find similar cases for Windows 11; this is just example. Though with Windows 11, the issue is not so common like Windows 10. "UX inconsistencies" - This is terrible. And not just UX but UI as well. Windows 11 may work but it's not a good product. Hundreds thousands of engineering hours, billions of USD... This might be the only choice by force due to the jettisoning of Windows 10, however the end product for all those resources spent is simply not good. The real problem is lack of competition. Linux derivatives and MacOS unfortunately are not competitive. -
-
-
By zikalify · Posted
Grab Motorola's Razr Ultra 2025 at 15% off and ditch your slab phone by Paul Hill Motorola is currently selling the Razr Ultra 2025 on Amazon at a discount of 15%, meaning you can pick it up now for $1,099.99 instead of the usual $1,299.99. This is a notable saving on a premium foldable smartphone, but it still remains a high-end purchase. Any Prime members out there can get free overnight delivery and if you have an old device to trade in, then you can get up to $725 in Amazon.com Gift Card credit that you can use towards your upgrade. One of the main perks of this device is that it’s universally unlocked, meaning you can use it on all major US carriers. It’s powered by the Snapdragon 8 Elite and comes with 16GB RAM and 512GB storage. With these specs, this device should be able to run any apps you throw at it. The Pantone Scarab color, a soft, velvety suede-like texture, is the result of a collaboration with the Italian brand Alcantara, known for its premium materials, giving the phone a very unique look. As a flip phone, you also get an intelligent and interactive external display that lets you access apps without opening your phone. Even with this external display, Motorola says you can expect over 36 hours of battery life and when you do need to recharge, you have fast charging. The main display on this device is 7 inches and features a Super HD resolution which is 2992 x 1224, the refresh rate is 165Hz. The external display has a resolution of 1272 x 1080. This phone could be a good pick for fashion-conscious users with its unique materials. It’s also a great device for anyone after a compact form factor or who is a fan of Motorola devices. The style, compact design, external display, fast performance, and improved camera system (50MP) are all positives on this device. There’s also IP48 rating for dust and water protection, adding durability. Motorola Razr Ultra 2025: $1,099.99 (Amazon US) / MSRP $1,299.99 This Amazon deal is US-specific and not available in other regions unless specified. If you don't like it or want to look at more options, check out the Amazon US deals page here. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. As an Amazon Associate, we earn from qualifying purchases.
-
-
Recent Achievements
-
BA the Curmudgeon earned a badge
One Month Later
-
Doreen768 earned a badge
First Post
-
James_kobe earned a badge
One Month Later
-
James_kobe earned a badge
Week One Done
-
macomen earned a badge
Week One Done
-
-
Popular Contributors
-
Tell a friend
Question
SkyyPunk Veteran
First of all, my Java is fairly rusty (just started using again after a 6 year hiatus). I am working on this for Android 2.1
Goal:
I have multiple buttons, they all perform the same task, but with different data pulled from an array. For example, button1, button2, button3. I want to use the same onClick for all of them so they share the same code base. if button1 is clicked, text1 is updated, etc
The problem:
I can't figure out how to determine which of the buttons triggered the onClick event. I have seen references to getTag, and getId, but when I check what those contain while debugging, its always empty.
Is there a way to either get the button name in onClick, or maybe a way to pass it another parameter so I can just tell it to pass the ID when I set up the onClick listener?
Thanks!
Link to comment
https://www.neowin.net/forum/topic/896148-java-android-onclick-event-get-the-sender-id-tag/Share on other sites
8 answers to this question
Recommended Posts