Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8517863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:49:24+00:00 2026-06-11T05:49:24+00:00

I need to enable LED blinking on when the use click the button in

  • 0

I need to enable LED blinking on when the use click the button in tablet. Here i created a sample application using below code. This code is working fine in Mobile (HTC Sensation). When i use the same code for Tablet, it won’t work. Why this will happens, there is no error message in Log Cat. I used Toshiba Thrive AT100 tablet.

LED_Blinking_Activity.java

public class LED_Blinking_Activity extends Activity {

    Button on, off;
    int LED_NOTIFICATION_ID = 0;
    Context context;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_led__blinking_);
        on = (Button) findViewById(R.id.button1);
        off = (Button) findViewById(R.id.button2);
        final Vibrator vibe = (Vibrator) this
                .getSystemService(VIBRATOR_SERVICE);
        on.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                // TODO Auto-generated method stub
                NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
                Notification notif = new Notification();
                notif.ledARGB = 0xFFff0000; // Green color 0xFF00FF00
                notif.flags = Notification.FLAG_SHOW_LIGHTS;
                notif.ledOnMS = 100;
                notif.ledOffMS = 1000;
                nm.notify(LED_NOTIFICATION_ID, notif);

                vibe.vibrate(50); // 50 is time in ms

            }
        });

        off.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                // TODO Auto-generated method stub
                ClearLED();
            }
        });
    }

    private void ClearLED() {
        NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
        nm.cancel(LED_NOTIFICATION_ID);
    }

    private Runnable mClearLED_Task = new Runnable() {
        public void run() {
            synchronized (LED_Blinking_Activity.this) {
                ClearLED();
            }
        }
    };
}

activity_led_blinking.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="45dp"
        android:text="Turn on LED" />

    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignRight="@+id/button1"
        android:layout_centerVertical="true"
        android:text="Turn o LED" />

</RelativeLayout>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:49:25+00:00Added an answer on June 11, 2026 at 5:49 am

    Many Android tablets do not have notification leds. Based on this product specification it appears that this tablet does not have one either. You can’t flash the led if the device doesn’t have one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my problem: I need to enable a button if the text is
Here: http://freshmeat.net/projects/myperl/ I need to enable PHP in MySQL
I have a Button on appwidget, that I need to 'enable'/'disable' programmatically from a
How can I remove the 'unbind' after using it? I need to enable back
I need to turn off the gsm network at my application but enable bluetooth.
We need to enable our customers to update some components in Android application, like
I'm writing a GUI application where I need to enable editing properties of arbitrary
I need to enable the validation of hidden fields using ASP.net MVC3 unobtrusive validation.
I need to enable zooming on the Silverlight charts I use - at the
I need to enable a button when a JS file is finished loading. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.