Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Programm hängt sich auf

Empfohlene Antworten

Veröffentlicht

Tachen Zusammen, habe ein kleines Problem, ich habe mir ein kleines programm geschrieben aber leider hängt es sich bei einer funktion immer auf und es reagiert nicht mehr.


public void ruhemodus(int timeout) throws Exception

    {

        ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();


        ScheduledFuture<Exception> f = executor.schedule(new Callable<Exception>()

        {

            @Override

            public Exception call()

            {

                try

                {

                	System.out.println("erg: "+timeout);

                    shutDown.exec("rundll32 powrprof.dll,SetSuspendState");

                    System.exit(timeout);

                	return null;

                }

                catch (IOException e)

                {

                    return e;

                }


            }

        }, timeout, TimeUnit.SECONDS);

        throw f.get(timeout, TimeUnit.SECONDS);

    }

Das ist der code wo das problem auftritt.

Es soll folgendermaßen funktionieren, der benutzer gibt eine zeit ein, diese wird in sekunden umgerechnet und der Pc soll dann zum beispiel in 1 stunde in den ruhemodus versetzt werden.. aber sobald ich die eingabe bestätige reagiert das programm nicht mehr.

Weiß jemand woran es hier scheitert ?

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.