I have Activity B
and Activity C
, in which Activity A
can be triggered using Intent
.
How to recognize in Activity A
, which of them was launched?
I have Activity B
and Activity C
, in which Activity A
can be triggered using Intent
.
How to recognize in Activity A
, which of them was launched?
the simplest: in Activi B -
Intent bIntent = new Intent(ActivityB.this, ActivityA.class); bIntent.putExtra("activity_type", "activityB"); startActivity(bIntent);
In Activation C -
Intent сIntent = new Intent(ActivityС.this, ActivityA.class); сIntent.putExtra("activity_type", "activityС"); startActivity(сIntent);
In Activation A -
@override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState) // other String type = getIntent().getStringExtra("activity_type") // other }
Source: https://ru.stackoverflow.com/questions/548361/
All Articles