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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -