-1

I wants to know if there are any other ways to pass data from one Activity to another Activity without using bundle(Intent), Sharedpreference and database(SQLITE). If there are any other way,please suggest me those.

Manish Singh Rana
  • 822
  • 1
  • 13
  • 26

2 Answers2

0

You could pass data between activities via:

  1. Extras bundle while starting new activity;
  2. Result bundle if you're using startActivityForResult;
  3. Broadcast receivers.

All of the methods above are using Intents. If you want to avoid Intents usage (you shouldn't), as a alternative look at event busses (EventBus, Otto etc.) Also please keep in mind that Database and SharedPreferences haven't designed for such purposes. Instead of this you could use them as a long-term storage.

Stas Lelyuk
  • 538
  • 6
  • 19
0

Options for storing data in android :

  1. Using Intents
  2. Using Bundle
  3. Using Shared Preferences
  4. Using files
  5. Using SQLite
  6. Using Server

If you need to pass small data(ex. string) use intents. For big data you should go for SQLite or Server. If you need to retain small data throughout the app, use shared preferences.

Sharad Chauhan
  • 4,821
  • 2
  • 25
  • 50