Calling prediction only once when resuming MainActivity.