私のアプリ android:minSdkVersion="8" では、次の警告が表示されます。現在、私のコードは API 17 で問題ありません。私のアプリが将来の Android バージョンで常に正常に動作するかどうか教えていただけますか? ありがとう!
コンストラクター simplecursodapter(context, int, cursor, string[], int[]) は非推奨です
私のアプリ android:minSdkVersion="8" では、次の警告が表示されます。現在、私のコードは API 17 で問題ありません。私のアプリが将来の Android バージョンで常に正常に動作するかどうか教えていただけますか? ありがとう!
コンストラクター simplecursodapter(context, int, cursor, string[], int[]) は非推奨です
It depends on those guy, when they can remove it depends on them. Deprecated meaning? is here.
By reviewing the SimpleCursorAdapter doc, you will get two methods.. The one you are using SimpleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to) and another is SimpleCursorAdapter(Context context, int layout, Cursor c, String[] from, int[] to, int flags) which added in API 11 after deprecation of previous.
The docs says
This constructor was deprecated in API level 11. This option is discouraged, as it results in Cursor queries being performed on the application's UI thread and thus can cause poor responsiveness or even Application Not Responding errors. As an alternative, use LoaderManager with a CursorLoader.
So You should modify your method as
if(android.os.Build.VERSION.SDK_INT >= 11) {
//Call another constructor
} else {
//the constructor which you are calling
}
通常、機能が非推奨になると、同じことを行う新しい方法が提供されます。その新しいやり方に移行する必要があります。
今は使えますが、将来消える可能性もあります。