I want to combine 2 android projects together in such a way that when an button is pressed from one activity (of 1st project ) it should start my activity from (2nd project)
If all you need is to show a new MainActivity instance you need to declare an intent-filter in your "2nd project" manifest:
MainActivity
Then create an intent with the same action string in your first project:
Intent intent = new Intent("your.package.here.MainActivity"); startActivity(intent);