android - Is it better to pass data via intent or query the database when needed? -


i wondering better way handle data in several activities in android.

say had 2 activities, , b, hold views. first load data sql database , inflate views in a. now, want start activity b, uses same set of data did.

is better pass data via intent (putextra()) , inflate views or better query database again , inflate.

i not sure that, because both approaches seem have disadvantages:

  • querying database takes more time /more resources
  • putting data intent makes more complex, because of putting , getting data (especially when working more activities)

can give me advice on best practice?

as compare db query use intent.

and way is, use 1 common class holds data temporary.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -