0

I have android project that Its is now a android library project. I have set up two projects(A and B) that use the library project. So for example when I start project A it uses all of the activities from the lib project. The question is how to now make the library project start a activity from the project A? Lats say that LibActivity is a activity defined in the libProject so for example I have:

**LibActivity1** starts **LibActivity2**
**LibActivity2** starts **LibActivty3** 
and now I need LibActivity3 to start **projectA_Activity** or **projectBActivity** 
depending on the build

Thanks

user1796624
  • 3,665
  • 7
  • 38
  • 65
  • Perhaps explain what your trying to achieve by calling an activity from your lib, i would have thought that your activities in the lib would come to a natural end, and not be dependant on another project. As such you could call the lib activity with a startActivityForResult() call, then finish() in the lib to return to the main activity. – Emile Dec 13 '12 at 11:02

1 Answers1

0

I would call the library activity with a startActivityForResult() call and then finish() the library activity, returning to your Project activity. You can then test the result to determine which project activity to move on to next.

Emile
  • 11,451
  • 5
  • 50
  • 63
  • thanks for the response but i solved using reflection: Class activity=HotelDistrictListActivity.class.getClassLoader().loadClass( "com.myactivity.CreditCartActivity"); startActivity(this,activity) – user1796624 Dec 13 '12 at 18:03