在我的gradle文件中使用: buildToolsVersion "22.0.1" , targetSdkVersion 22 。 我发现有用的getResources().getColor(R.color.color_name)已被弃用。 我应该用什么来代替?
在iOS5及更高版本中,UIDevice的uniqueIdentifier属性已被弃用 。 似乎没有其他方法或财产可用或即将出现。 我们现有的许多应用程序都严格依赖于此属性来唯一标识特定的设备。 任何人都可以提出任何想法,我们可以如何处理这个问题呢? 从文档的build议是… 特别注意事项 不要使用uniqueIdentifier属性。 要创build特定于您的应用程序的唯一标识符,您可以调用CFUUIDCreate函数来创buildUUID ,并使用NSUserDefaults类将其写入默认数据库。 但是,如果用户卸载并重新安装应用程序,则此值不一样。
我有这个方法: public String getRealPathFromURI(Uri contentUri) { String[] proj = { MediaStore.Images.Media.DATA }; Cursor cursor = managedQuery(contentUri, proj, null, null, null); int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); cursor.moveToFirst(); return cursor.getString(column_index); } 不幸的是,编译器向我展示了一个问题: Cursor cursor = managedQuery(contentUri, proj, null, null, null); 由于managedQuery()已被弃用。 我怎么能重写这个方法,而不使用managedQuery() ?
我必须使用一个OnGlobalLayoutListener对象,然后删除侦听器,我有一个问题与我解决以下代码的不推荐使用的方法。 protected void onCreate(Bundle savedInstanceState) { final LinearLayout llTotal = (LinearLayout) findViewById(R.id.mmc_ll); ViewTreeObserver vto = llTotal.getViewTreeObserver(); if(vto.isAlive()){ vto.addOnGlobalLayoutListener(new OnGlobalLayoutListener() { @Override public void onGlobalLayout() { // // mycode // if (Build.VERSION.SDK_INT<16) { removeLayoutListenerPre16(llTotal.getViewTreeObserver(),this); } else { removeLayoutListenerPost16(llTotal.getViewTreeObserver(), this); } } }); } super.onCreate(savedInstanceState); } @SuppressWarnings("deprecation") private void removeLayoutListenerPre16(ViewTreeObserver observer, OnGlobalLayoutListener listener){ observer.removeGlobalOnLayoutListener(listener); } @TargetApi(16) private […]
我试图创build一个这样的date: date = new Date(year-1900,mon-1,day,hrs,min,sec); Eclips给了我这个警告:“构造函数Date(int,int,int,int,int)已被弃用”。 对于一个构造函数是什么意思呢? 我能做什么?
在Visual Studio 2005 C ++编译器上 ,当我的代码使用fopen和这样的调用时,我得到以下警告。 1>foo.cpp(5) : warning C4996: 'fopen' was declared deprecated 1> c:\program files\microsoft visual studio 8\vc\include\stdio.h(234) : see declaration of 'fopen' 1> Message: 'This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_DEPRECATE. See online help for details.' 我如何防止这种情况?
我来自C#世界,所以对Java还没有太多的经验。 Eclipse刚刚告知, Date已被弃用。 Person p = new Person(); p.setDateOfBirth(new Date(1985, 1, 1)); 为什么? 什么(特别是在上面的情况下)应该用来代替?
其实没有问题 项目编译并运行。 但我不明白是什么意思罢工类名称(Android Studio告诉有使用废弃的代码) 。 有人可以解释吗?
如何解决PHP 5.3中的session_register()弃用问题
在iOS 7中, sizeWithFont:现在已被弃用。 现在如何将UIFont对象传递给替换方法sizeWithAttributes: :?