How can i make a callback to an Activity form a Java Class?
Example:
public class TestClass{
String text = "Test";
public TestClass(Context context){
startActivity(new Intent(context, SomeActivity.class));
}
private void sendToSomeActivity(){
//Call some method of SomeActivity and pas text as string
}
}
When sendToSomeActivity()
is called, i want to make a callback to the already started SomeActivity
and pass some text to the Activity. In SomeActivity
i want to use the text.
Note: The TestClass object that i want to use is already created in another class.
How can this be done?