i am using unity 4.6.3 , on that version onapplicationquit() function is not working , i want to save playerprefs in that function but it is not save the values and game state and also use dontdestroyonload() function
OnApplicationQuit() is NOT guaranteed to be called on Android. You can read more about that here, but Android activities that have been paused are NOT guaranteed to always give a Quit callback. Due to this design, many developers instead save crucial data at other points (scene loads, game over screens, checkpoint, etc). If you need this precise data on any application suspension (with a quit possibly ahead), a popular alternative is OnApplicationPause().
OnApplicationQuit must not be private, in order for Unity to call the function when it closes the application. Simply remove the private keyword in front of void OnApplicationQuit().