Android LoaderManager Callbacks -
hi i'm using onloadfinished callback set variables
public class mainactivity ... double foo; ... public void onloadfinished(loader<cursor> loader, cursor cursor) { if (cursor.movetofirst()){ int index = cursor.getcolumnindex(database_table.field); double value = cursor.getdouble(index); if (lat > 0) **foo = value;** } }
but, when try use variable seems unset.
what doing wrong?
should synchronize method main thread?
p.d cursor have data.
the mainactivity class has implement loadercallbacks interface like
public class mainactivity implements loadermanager.loadercallbacks<cursor>
then should provide instance parameter initloader method
Comments
Post a Comment