Clear out your cache and data on all our apps. Google and Face Book particularly. I had the same problem. First the keyboard stopped working, then the phone operations slowed down, then the screen would flash on and off. Etc. Too much junk in the cache. Then Restart when you're done.