In my application I need a variable from one activity to another activity without using any intent. So I have declared that variable as static and used as FirstActivit
Try this.
Step 1: Create a static Bundle object in Application class.( ApplicationClass.java)
E.g :
public static Bundle mMyAppsBundle = new Bundle():
Step 2:
Set key values pair in that bundle from anywhere. like this:
ApplicationClass.mMyAppsBundle.putString("key","value");
Step 3:
Now you can get these values from anywhere like this way:
String str = ApplicationClass.mMyAppsBundle.getString("key");
Please apply null check before using bundle objects for safety points of view.