How to deal with deprecated classes in Android to keep compatibility

You can do that (checking the API version). You can also use reflection to call the newer classes. I wouldn’t worry about using deprecated methods as all Android versions are backwards compatible, saying that you want to watch when things are for 3.0 Honeycomb as these are a little different. Here’s an explanation of how … Read more

How can I fix the “UIPopoverController is deprecated” warning?

You no longer need UIPopoverController for presenting a view controller. Instead you can set the modalPresentationStyle of view controller to UIModalPresentationPopover. You can use the following code for that: avc.modalPresentationStyle = UIModalPresentationPopover; avc.popoverPresentationController.sourceView = theButton; [self presentViewController:avc animated:YES completion:nil]; UIModalPresentationPopover In a horizontally regular environment, a presentation style where the content is displayed in a … Read more

What does PHP do with deprecated functions?

Deperecated functions still exist and you get the warning. So they work as expected. However in a future version they might disappear. That’s the same for other deprecated language features which you sometimes get notices about. It’s a way to signal changes to users which have code based on an older PHP version. Normally the … Read more

CSS replacement for

The text align center covers most of the text elements but a little extra is needed to centre align the table div {width:400px; text-align:center;} table {margin: 0 auto;} table td {text-align: left;} http://jsfiddle.net/NYuv8/4/

Alternative to contextlib.nested with variable number of context managers

The new Python 3 contextlib.ExitStack class was added as a replacement for contextlib.nested() (see issue 13585). It is coded in such a way you can use it in Python 2 directly: import sys from collections import deque class ExitStack(object): “””Context manager for dynamic management of a stack of exit callbacks For example: with ExitStack() as … Read more

GET_TASKS Permission Deprecated

There is reason why it is deprecated. The protection Level of android.permission.GET_TASKS has been elevated to signatureOrSystem. There is no easy and unharmful solution for that. As of LOLLIPOP, this method is no longer available to third party applications: the introduction of document-centric recents means it can leak personal information to the caller. For backwards … Read more