When exactly are onSaveInstanceState() and onRestoreInstanceState() called?

Per the documentation: void onRestoreInstanceState (Bundle savedInstanceState) This method is called between onStart() and onPostCreate(Bundle). void onSaveInstanceState (Bundle outState) If called, this method will occur after onStop() for applications targeting platforms starting with Build.VERSION_CODES.P. For applications targeting earlier platform versions this method will occur before onStop() and there are no guarantees about whether it will … Read more

Restore already bought in-app-purchases on iPhone?

If the $0.99 item is non-consumable, then you should provide a “Restore Purchases” button (or similar) which calls [[SKPaymentQueue defaultQueue] restoreCompletedTransactions]; Assuming you’ve added a transaction observer already, and implemented the protocol including a case to handle a restored transaction (with state SKPaymentTransactionStateRestored) this will work.

How to restore to a different database in SQL Server?

You can create a new db then use the “Restore Wizard” enabling the Overwrite option or: View the contents of the backup file: RESTORE FILELISTONLY FROM DISK=’c:\your.bak’ note the logical names of the .mdf & .ldf from the results, then: RESTORE DATABASE MyTempCopy FROM DISK=’c:\your.bak’ WITH MOVE ‘LogicalNameForTheMDF’ TO ‘c:\MyTempCopy.mdf’, MOVE ‘LogicalNameForTheLDF’ TO ‘c:\MyTempCopy_log.ldf’ This … Read more

How to take backup of a single table in a MySQL database?

Dump and restore a single table from .sql Dump mysqldump db_name table_name > table_name.sql Dumping from a remote database mysqldump -u <db_username> -h <db_host> -p db_name table_name > table_name.sql For further reference: http://www.abbeyworkshop.com/howto/lamp/MySQL_Export_Backup/index.html Restore mysql -u <user_name> -p db_name mysql> source <full_path>/table_name.sql or in one line mysql -u username -p db_name < /path/to/table_name.sql Dump and … Read more