我创建了一个按钮来触发我的应用程序上的脉冲 LED 动作,但我不能让它永远脉冲。它总是按值脉冲(在上面的示例中,您会看到它脉冲 10 次然后停止)
//Button Pulse
Button bpulse = (Button) findViewById(R.id.bpulse);
bpulse.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent led = new Intent(IlluminationIntent.ACTION_START_LED_PULSE);
led.putExtra(IlluminationIntent.EXTRA_PACKAGE_NAME, "com.devsgonemad.xslc");
led.putExtra(IlluminationIntent.EXTRA_LED_ID,
IlluminationIntent.VALUE_BUTTON_2);
led.putExtra(IlluminationIntent.EXTRA_LED_NO_OF_PULSES, 10);
led.putExtra(IlluminationIntent.EXTRA_LED_PULSE_ON_TIME, 1000);
led.putExtra(IlluminationIntent.EXTRA_LED_PULSE_OFF_TIME, 1000);
led.putExtra(IlluminationIntent.EXTRA_LED_COLOR, m_ledColor);
startService(led);
m_isEnabled = true;
}
当按下按钮直到用户返回应用程序并停止脉冲时,我怎样才能永远使这个脉冲?
最好的祝福