change method chargeArray() MainActivity to Logic