Satheesh Kumar R CyB
Satheesh Kumar R CyB

Reputation: 125

Is good to use static variable in fragments?

Is good to use static variable in fragments? Because it is difficult to maintain the data between fragments while Poping and adding fragments or orientation change. savedInstanceState only help in orientation change not while poping back the previous fragments. P.S i'm going to save only arrays as static.

Upvotes: 0

Views: 782

Answers (1)

Bhavishya Prajapati
Bhavishya Prajapati

Reputation: 160

You should use a base fragment class for all your fragment. and there is no problem to work with static variable.

Upvotes: 1

Related Questions