android: send & get String besides by using extra() method

后端 未结 1 530
广开言路
广开言路 2021-01-22 11:35

I just wonder what method can be use to send String from one to another activity besides by using intent.putExtra(), and getIntent.getExtra(). Cause my project getting unexpecte

相关标签:
1条回答
  • 2021-01-22 12:05

    you can also send by following ways

    How do I pass data between Activities/Services within a single application?

    Non-Persistent Objects

    For sharing complex non-persistent user-defined objects for short duration, the following approaches are recommended:

    • Singleton class - Ref Here:

    • A public static field/method

    • A HashMap of WeakReferences to Objects

    0 讨论(0)
提交回复
热议问题