My app with deprecated function can work well in future Android version? -


in app android:minsdkversion="8", following warning. code ok in api 17, tell me if app can work in future android version? thanks!

the constructor simplecursoradapter(context, int, cursor, string[], int[]) deprecated

it depends on guy, when can remove depends on them. deprecated meaning? here.

by reviewing the simplecursoradapter doc, 2 methods.. 1 using simplecursoradapter(context context, int layout, cursor c, string[] from, int[] to) and 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 deprecated in api level 11. option discouraged, results in cursor queries being performed on application's ui thread , can cause poor responsiveness or application not responding errors. alternative, use loadermanager cursorloader.

so should modify method

if(android.os.build.version.sdk_int >= 11) {     //call constructor  } else {     //the constructor calling } 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -