android - Get JSON in fragment one and save then show data in fragment tow -
in app have 2 fragment in view pager in fragment 1 have list view, in item list view have :tile, image , button want when click button can load json sever , save in folder(file txt) of sd card , when click again can delete content in txt file , stored data can show in fragment tow. did following method without success: when click button start new thread request json , have data,then save when show 2 fragment can't it, when restart app can problem occurs here thread runs parallel activity , when restart application results of thread measures have take results thread has completed download data? or or measures might me it? thank much
it great if use shared preferences acheiving this. use separate thread download json server , directly save shared preferences. once want show data on second fragment fetch shared preference.
Comments
Post a Comment