onclick

Dynamic Buttons and OnClickListener

不问归期 提交于 2019-12-08 07:50:42
问题 Say I have buttons that are created dynamically: for(int j = 0; j < spirits.length; j++){ Button imgBtn = new Button(v.getContext()); imgBtn.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); imgBtn.setMinimumWidth(100); imgBtn.setMinimumHeight(100); imgBtn.setId(j+1); imgBtn.setTag(spirits[j]); imgBtn.setText(spirits[j]); imgBtn.setOnClickListener(new SpiritsClickListener()); cabinet_layout.addView(imgBtn); } I want to change the text of the button every

Cannot Click item in a ListView to show YouTube Video

痴心易碎 提交于 2019-12-08 07:44:57
问题 I've used the following example to build a listview with an onClick listener which should launch YouTube when a thumbnail is clicked. However the youtube application does not launch onClick. public class Home extends YouTubeBaseActivity implements VideoClickListener { private VideosListView listView; public static final String API_KEY = "AIzaSyC0Te2pyooXzuyLaE6_SsFlITKCwjj55fI"; public static final String VIDEO_ID = "o7VVHhK9zf0"; String PLAYLIST = "vevo"; Activity activity; int imageArray[];

Jquery - mouse over -> fade in/out // click -> opacity 100% // other click -> opacity 60

六眼飞鱼酱① 提交于 2019-12-08 07:44:46
问题 Iam working on a website with jquery and thumbnails. When the page is loaded all the thumbnails have to be on 60% of opacity. As soon as you go with your mouse over a thumb it needs to fade to 100%, if you move with your mouse out the thumbnail needs to fade back up on 60% of opacity. When the user click on a thumbnail it have to stay at 100% of opacity. As soon as the user click on another thumbnail the 'old' thumbnail has to fade back to 60% and the 'new' one has to stay at 100%. (it

html button inside ng-repeat is not working

醉酒当歌 提交于 2019-12-08 07:33:57
问题 I'm trying to import a list of customers, and I want to proceed to a personalized customer page with specific information about a customer (using function showit). I currently have this: <table ng-controller="patientsCtrl" class="table-responsive" class="fixed"> <thead> <th>ID</th> <th>Name</th> <th>Policy Nr</th> <th>Pol. Type</th> <th>Check</th> </thead> <tbody> <tr ng-repeat="p in patients | orderBy:'patID'"> <td>{{ p.patID }}</td> <td>{{ p.name }}</td> <td>{{ p.policy_number }}</td> <td>{

<button> JQuery onclick works only once

你。 提交于 2019-12-08 07:24:56
问题 I have a button onclick event that works fine like here: // create function to remove "popup-open" classes // function used in onclick attribute (function( $ ){ $.fn.popupClose = function() { $( "body" ).removeClass( "popup-open" ) $( ".overlay_btn" ).removeClass("popup-open"); return this; }; })( jQuery ); // if a <button> exists // onclick read button ID value // add "popup-open" class to span with IDvalue as class, with fadein effect if ( $( "button.popup" ).length ) { $("button.popup")

How to get OnItemClickListener for SimpleAdapter working

僤鯓⒐⒋嵵緔 提交于 2019-12-08 06:40:40
问题 i'm new to android and i have a question. i'm using a SimpleAdapter with a ViewBender to display images and text. However i cant figure out how to set up the OnItemClickListener for the SimpleAdapter. How do i do it? This is how i initialize it: SimpleAdapter notes = new SimpleAdapter(Main.this, list, R.layout.main_list_row, PARAM, new int[] { R.id.icon, R.id.name, R.id.content }); notes.setViewBinder(new MyViewBinder()); setListAdapter(notes); thanks in advance 回答1: Try below code I think

How do I get edittext value from a custom AlertDialog where retrieval of values is not in the onClick?

给你一囗甜甜゛ 提交于 2019-12-08 06:35:50
问题 What I am trying to do is to create a custom dialog that overrides an AlertDialog. What it is supposed to do is get some text (at least 2 strings) and then for each of those strings it is supposed to be able to get more information, but I want to do this in custom dialogs. So what is supposed to happen is a user can enter 2 people in an activity screen, and then for the first person, you get a custom dialog and that person can enter three words, and then it jumps to the next custom dialog

How to stop ListView recycling?

与世无争的帅哥 提交于 2019-12-08 04:53:07
问题 I'm an Android beginner and I can't figure out why this is happening. Activity Screenshot: Everything works fine except when I scroll down (hence why I think it has to do with recycling)... So when I scroll back up and attempt to undo the vote (red arrow) on the first post, it thinks the post is voted down! Alternatively, it may also think the down-vote ImageButton drawable is empty - see code). If I don't scroll, it works perfectly. getView code: public View getView(int position, View

Javascript scroll to element with animation onclick

大城市里の小女人 提交于 2019-12-08 04:52:55
问题 I'm just starting out with JS and struggling. I got this lovely bit of code from Adam Khoury and it's working beautifully animated scrolling down the page to the target element. The ul is within a fixed position navigation bar. My question is: what code would be needed to make the animation scroll both up and down when the anchor in the nav is clicked? var scrollY = 0; var distance = 10; var speed = 24; function autoScrollTo(el) { var currentY = window.pageYOffset; var targetY = document

Android jellybean with Phonegap click not working

喜你入骨 提交于 2019-12-08 04:05:48
问题 We are developing a Android Hybrid application using phonegap 3.2.2. In one of the html page, we are rendering an 'svg' element with 'path' elements inside the svg. Each path element is bind to a click event using the jquery. The issue we are facing is the "onclick event will not be triggered only for some of the path elements and for rest it is working fine " and also this we are getting only in the devices with Android OS 4.2 and 4.3 (All "Jelly Bean"). If anyone has faced the similar issue