I want to retrive the name of the calling activity for checking some conditions.. What will be the solution?
I think you can achieve this even with
getCallingActivity().getClassName()
You can send data between activities using Bundle
Have a look at this example: http://www.balistupa.com/blog/2009/08/passing-data-or-parameter-to-another-activity-android/
Basically you need to put the name of the caller as parameter:
Bundle bundle = new Bundle();
bundle.putString(this.class.getName(), “ClassName”);
Intent newIntent = new Intent(this.getApplicationContext(), ActivityClass2.class);
newIntent.putExtras(bundle);
startActivityForResult(newIntent, 0);
And in ActivityClass2, you can read this parameter using:
Bundle bundle = this.getIntent().getExtras();
String className = bundle.getString(“ClassName″);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With