android - Shared preferences and explicit intents? -


hi can answer,

so came across question (it assignment, submitted anyways). regarding shared preferences , explicit intents. know both can pass data (through putstring, putextra, putint etc , getextra, getstring, getint). method better pass data , why? can in terms of functionality or how lesser codes when comparing each method each other.

if want pass data when transitioning 1 activity activity, it's better use intents pass data.

however if want data passing still retrievable after user exit app , reopen it, should use sharedpreferences.

intent better use when passing data when going 1 activity another. otherwise, should use sharedpreferences instead. , mentioned above, if want data stored , retrievable when user reopens app, should go storage option sharedpreferences.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -