Html.fromHtml deprecated in Android N

update: as @Andy mentioned below Google has created HtmlCompat which can be used instead of the method below. Add this dependency implementation ‘androidx.core:core:1.0.1 to the build.gradle file of your app. Make sure you use the latest version of androidx.core:core. This allows you to use: HtmlCompat.fromHtml(html, HtmlCompat.FROM_HTML_MODE_LEGACY); You can read more about the different flags on … Read more

Replacement for deprecated sizeWithFont: in iOS 7?

Use sizeWithAttributes: instead, which now takes an NSDictionary. Pass in the pair with key UITextAttributeFont and your font object like this: CGRect rawRect = {}; rawRect.size = [string sizeWithAttributes: @{ NSFontAttributeName: [UIFont systemFontOfSize:17.0f], }]; // Values are fractional — you should take the ceil to get equivalent values CGSize adjustedSize = CGRectIntegral(rawRect).size;

Why is the DOMSubtreeModified event deprecated in DOM level 3?

If you scroll down a bit, you see: Warning! The MutationEvent interface was introduced in DOM Level 2 Events, but has not yet been completely and interoperably implemented across user agents. In addition, there have been critiques that the interface, as designed, introduces a performance and implementation challenge. A new specification is under development with … Read more

Where has fn.toggle( handler(eventObject), handler(eventObject)…) gone?

Deprecation of jquery .toggle() is now documented at api.jquery.com. I found a nice replacement for it at forum.jquery that I am now using. It works great 🙂 $.fn.toggleClick = function() { var functions = arguments, iteration = 0; return this.click(function() { functions[iteration].call(); iteration = (iteration + 1) % functions.length; }); } Usage: $(“#target”).toggleClick(function() { alert( … Read more

Deprecated: mysql_connect() [duplicate]

There are a few solutions to your problem. The way with MySQLi would be like this: <?php $connection = mysqli_connect(‘localhost’, ‘username’, ‘password’, ‘database’); To run database queries is also simple and nearly identical with the old way: <?php // Old way mysql_query(‘CREATE TEMPORARY TABLE `table`’, $connection); // New way mysqli_query($connection, ‘CREATE TEMPORARY TABLE `table`’); Turn … Read more

Environment.getExternalStorageDirectory() deprecated in API level 29 java

Use getExternalFilesDir(), getExternalCacheDir(), or getExternalMediaDirs() (methods on Context) instead of Environment.getExternalStorageDirectory(). Or, modify mPhotoEditor to be able to work with a Uri, then: Use ACTION_CREATE_DOCUMENT to get a Uri to a location of the user’s choosing, or Use MediaStore, ContentResolver, and insert() to get a Uri for a particular type of media (e.g., an image) … Read more

What are the alternatives now that the Google web search API has been deprecated? [closed]

Yes, Google Custom Search has now replaced the old Search API, but you can still use Google Custom Search to search the entire web, although the steps are not obvious from the Custom Search setup. To create a Google Custom Search engine that searches the entire web: From the Google Custom Search homepage ( http://www.google.com/cse/ … Read more