Historical Context
Andrew lived during the first phase of Byzantine Iconoclasm, when the emperor Constantine V Kopronymos ordered Christians, under penalty of death, to remove the holy icons from their churches and homes. Those who resisted and held to the traditions of the Fathers were imprisoned.
According to his life, when Andrew heard that the emperor was throwing virtuous and pious Christians into prison in place of thieves and robbers, he went to the Church of the Great Martyr Mamas in Constantinople and publicly denounced the emperor for persecuting the true faith.