处理德precated android.text.ClipboardManager [英] Dealing with deprecated android.text.ClipboardManager

查看:94
本文介绍了处理德precated android.text.ClipboardManager的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

android.text.ClipboardManager 是因为空气污染指数11日precated,并与 android.content.ClipboardManager )。

android.text.ClipboardManager was deprecated since API level 11, and replaced with android.content.ClipboardManager (source).

我如何编写支持这两种情况下code?导入 android.content.ClipboardManager 和使用工作在11+,但武力10.关闭改变进口 android.text.ClipboardManager 抛出一堆去precation警告11 +。

How do I write code that supports both cases? Importing android.content.ClipboardManager and using that works in 11+ but force closes in 10. Changing the import to android.text.ClipboardManager throws a bunch of deprecation warnings in 11+.

我怎样才能顺利地处理这两种情况?我需要做什么导入?

How can I handle both cases smoothly? What do I need to import?

推荐答案

我最终只是用旧的方式(android.text.ClipboardManager和<一的code href="http://stackoverflow.com/questions/238284/how-to-copy-text-programatically-in-my-android-app/238297#238297">this回答),以及一对夫妇@燮pressWarnings(德precation)标注。

I ended up just using the old way (android.text.ClipboardManager and the code from this answer), along with a couple @SuppressWarnings("deprecation") annotations.

这篇关于处理德precated android.text.ClipboardManager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆