0

We are developing an app with a LoginActivity as main activity but, while developing, we configure the next activity to avoid writing user/password each time. I am starting with TDD and in order to avoid letting the wrong activity, I am trying to create a simple test that check that.

Is there any way to create a test that check what Activity is called when user click on the app icon? I have tried with an ActivityInstrumentationTestCase2 but it only let me choose what activity I want to test, not the complete app.

Thank you

victor.alm
  • 470
  • 1
  • 6
  • 14

1 Answers1

1

I'm not certain exactly what is being asked, but the launch intent of your application can be obtained via:

getPackageManager().getLaunchIntentForPackage(context.getPackageName())

See for example Get the launcher Activity name of an android application

Community
  • 1
  • 1
Joe Bowbeer
  • 3,037
  • 2
  • 32
  • 42