listeners

How to stop location listeners

雨燕双飞 提交于 2021-02-11 12:53:27
问题 I'm trying to get the devices location by getting all listeners: LocationManager locationManager = (LocationManager) myContext.getApplicationContext() .getSystemService(Context.LOCATION_SERVICE); for (String s : locationManager.getAllProviders()) { locationManager.requestLocationUpdates(s, checkInterval, minDistance, new LocationListener() { @Override public void onProviderEnabled(String provider) { } @Override public void onProviderDisabled(String provider) { } @Override public void

How to delete all event listeners at once in AS3

天涯浪子 提交于 2020-02-01 04:58:40
问题 I'm making a small game in as3. The game contains 10 levels. When i enter 1 level everything is alright. But when i enter the second level (frame) the event listeners from the first frame are still working and a recieve a warning saying ' Cannot access an object of null objct reference'. This is because i delete every object of the first level and th add the objects from stage 2. I've tried using removeEventListeners, but it doesn't work, cause ENTER_FRAME Listeners work one more time after I

Blackberry background listener thread

三世轮回 提交于 2020-01-17 04:51:06
问题 Hey everyone! I am new to blackberry programming although I do have some java experience, with c# being my main language). What I am trying to do is write a thread that will run on system startup and exist in the background as a listener. I would like my app to implement KeyListener and basically sit in the background while the phone is on and track a histogram of how many times each button has been pressed. I'm currently running on the simulator so for now I'm just going to have it print to

Copying text from one EditText box to another in the same Activity on the fly, character-by-character

删除回忆录丶 提交于 2020-01-15 05:28:30
问题 I am building an application to convert Latitude and Longitudes between various formats. My layout is complete but my current challenge is this: For the Degree values, as the user enters a value in EditText1, I want it to replicate in EditText2 as they are typing, real-time, character for character. I have beat myself up trying OnTouchListener, onKeyboardActionListener, etc. Later, I will perform calculations on the Minutes, Seconds, and decimal portions as they are typed in. Since the Degree

How to resolve swing listener memory leaks?

会有一股神秘感。 提交于 2020-01-13 08:33:06
问题 Background So I read that often memory leaks within Swing applications originate from the use of various listeners (mouse, key, focus, etc). Essentially, because you register an object as a listener and forget to deregister the object, the notifier ends up holding onto the reference of the object, and leaks a bit of memory. I knew our application wasn't deregistering listeners and did a bit of research on potential solutions: I found one approach in dealing with the problem was the use of a

Jmeter Graph Listener for SampleResult.subResult

限于喜欢 提交于 2020-01-06 16:20:36
问题 I am looking for a jmeter graph listener that will output the subresults of a SamplerRequest object. I haven't found one yet and I'm very keen on getting it. 回答1: Old question, I know. Unfortunately, it appears that there are no JMeter graph listeners that will graph the results of sub results attached to a SampleResult. Having just been faced with the same problem, I chose to write my own. Steps: Compile the below class as a jar. Place the jar in jMeter's lib/ext folder. Open your test plan,

Selenium: Type mismatch: cannot convert from Class<CustomListeners> to Class<? extends ITestNGListener>[]

六眼飞鱼酱① 提交于 2020-01-06 14:36:28
问题 I am using TestNG framework. I have a Test1 class which extends BaseTestSuite . Also I have a CustomListeners class which implements WebDriverEventListener . When I use @Listeners(CustomListeners.class) annotation in the Test class, getting following error. Please help to resolve. Type mismatch: cannot convert from Class<CustomListeners> to Class<? extends ITestNGListener>[] Test Class @Listeners(CustomListeners.class) //Error line public class Test1 extends BaseTestSuite { LoginPage lp;

Selenium: Type mismatch: cannot convert from Class<CustomListeners> to Class<? extends ITestNGListener>[]

寵の児 提交于 2020-01-06 14:35:36
问题 I am using TestNG framework. I have a Test1 class which extends BaseTestSuite . Also I have a CustomListeners class which implements WebDriverEventListener . When I use @Listeners(CustomListeners.class) annotation in the Test class, getting following error. Please help to resolve. Type mismatch: cannot convert from Class<CustomListeners> to Class<? extends ITestNGListener>[] Test Class @Listeners(CustomListeners.class) //Error line public class Test1 extends BaseTestSuite { LoginPage lp;

Android Spinner - How to default list selection to none [duplicate]

六眼飞鱼酱① 提交于 2020-01-03 08:06:12
问题 This question already has answers here : How to make an Android Spinner with initial text “Select One”? (37 answers) Closed 6 years ago . I have an Android form that needs to update itself based on certain selections. The form is currently made up of 2 Spinners (A and B). Spinner B not created until Spinner A's selection is made. After the selection is made B will be displayed to the view and it's contents dynamically filled based on A's selection. Here is my code: public class MyForm extends

Flash AS3 EventDispatcher - any way of getting a list of registered listeners?

旧巷老猫 提交于 2020-01-01 02:42:25
问题 Is there any way of getting a list of registered listeners for an EventDispatcher ? I know that EventDispatcher has the hasEventListener method to tell you if any listeners are registered, but is there an easy way of interrogating the EventDispatcher to find out what the listeners are? One way I figured to do this was to subclass EventDispatcher to override the addEventListener method and store the listeners in a dictionary, but this feels clunky to me. Any ideas? 回答1: Ok, so it seems that