In going from an activity to another one by an intent, How can I get class loader name ? I need name of class loader. If my intention wasn't clear, Please look at this codes.
I created a test app for this Question. It has three activity. ActivityA , ActivityB and ActivityC. I have a button in ActivityA and ActivityB that start activityC.
ActivityA:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_a);
Button btnGoFromActivityAToActivityC = (Button) findViewById(R.id.btnGoFromActivityAToActivityC);
btnGoFromActivityAToActivityC.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent intent = new Intent(ActivityA.this, ActivityC.class);
startActivity(intent);
}
});
}
ActivityB:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_b);
Button btnGoFromActivityBToActivityC = (Button) findViewById(R.id.btnGoFromActivityBToActivityC);
btnGoFromActivityBToActivityC.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent intent = new Intent(ActivityB.this, ActivityC.class);
startActivity(intent);
}
});
}
ActivityC:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_c);
TextView textViewNameOfFirstActivity = (TextView) findViewById(R.id.textViewNameOfFirstActivity);
if (/* if we came from ActivityA */)
{
textViewNameOfFirstActivity.setText("You came from ActivityA");
}
else if (/* if we came from ActivityB */)
{
textViewNameOfFirstActivity.setText("You came from ActivityB");
}
}
Look at ActivityC...
How can I do this ?