Q:

move bundle without using intents - android

Is there any way in which I can move a bundle of data from one class to another without actually changing the layout?
For example:
I have 3 classes: class A, B and C.
Now class B has navigation drawer and bottom navigation menu implemented which can be seen on class A and C and also be used at the same time. 
However, I have a button in the bottom navigation menu which takes me to class C but the data which I need to view in this is in class A. 
Is there any way by which I can just send a bundle of data to class B but without using intents, then retrieve the data from class B and show it on class C?
** EDIT **
P.S : B is an AppCombatActivity extended class and A and C are Fragment extended classes. 

A:

Your question is very simple to implement but it can also become a headache. This is what you should do.
class A:
public class A extends Activity {

 static A INSTANCE;
 String data="A"; 

 @Override
  public void onCreate(Bundle savedInstanceState) {

    INSTANCE=this; 
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
   }

 public static A getActivityInstance()
   {
     return INSTANCE;
   }

 public String getData()
   {
     return this.data;
   }
}

class B:
public class B extends Activity {

 String data; 

 @Override
  public void onCreate(Bundle savedInstanceState) {
    data=A.getActivityInstance().getData();  
   }
}

The trick is to create an Instance in class A and then using that instance to access all the public elements like methods, variables etc using that Instance.
Hope this helps :)

