read from chosen file and give the data to the correct activity