An iPhone that keeps restarting is a serious but uncommon problem. Here are a few ways to try and fix the issue.
You should reset your Android device and erase all of your personal data before you sell it, trade it in, or give it away.