Code example for ScheduledExecutorService

Methods: shutdownNow

0
            } 
        }, 2, 2, TimeUnit.SECONDS);
    } 
 
    public void stop() { 
        executor.shutdownNow();
    } 
 
    public void insertMultiple(int count) {
        for (int i = 0; i < count; i++) {
            insert(); 
        } 
    } 
 
    private void insert() { 
        final ContentValues values = new ContentValues();
 
        values.put(SampleContract.Data.FIRST_NAME, RandomStringUtils.randomAlphabetic(10));
        values.put(SampleContract.Data.LAST_NAME, RandomStringUtils.randomAlphabetic(10));
 
        context.getContentResolver().insert(SampleContract.PEOPLE_URI, values);