Wiederholen Sie die Ausführung der Funktion Infini Android Studio

// this variable use to repeate execution of getLocation();
Runnable mStatusChecker = new Runnable() {
        @Override
        public void run() {
            try {
                getLocation(); // you can change this function by 
              //what ever you want
                
            } finally {
                mHandler.postDelayed(mStatusChecker, mInterval);
            }
        }
    };
// call this function in your code where you want start the function 
//ex getLocation
    void startRepeatingTask() {
        mStatusChecker.run();
    }
Mohamed Boumlyk