How to find last activity from which current activity is opened in android?

Your Question can be divided into two . First in the child activity only knowing the parent activity name and doing some code execution. For this @Matthew suggestion is right.

Second in the child activity getting the reference of parent activity for this read the link I mentioned. – Javanator Mar 29 at 4:56.

You might want to add extras to the intent you use to start the activity to indicate where the intent is coming from or what the request is. For example: Intent intent = new Intent(this, OtherActivity. Class); intent.

PutExtra("caller", "MainActivity"); startActivity(intent); and then your OtherActivity could detect the "caller" in its onCreate: String caller = getIntent(). GetStringExtra("caller").

I have used like this Intent intent = new Intent(this, OtherActivity. Class); intent. PutExtra("caller", getIntent().getComponent().getClassName()); startActivity(intent); – Dharmendra Mar 30 at 9:07 and then in other activity I have use String className = getIntent().

GetStringExtra("Caller") and then Class c = Class. ForName(className); so I can use that as my destination activity – Dharmendra Mar 30 at 9:09.

Intent intent = new Intent(this, OtherActivity. String caller = getIntent(). Class callerClass = Class.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions