Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Repeat execution of function 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();
    }
 
PREVIOUS NEXT
Tagged: #Repeat #execution #function #infini #android #studio
ADD COMMENT
Topic
Name
7+8 =