What is the difference betweeen Intent(getApplicationContext(), class) and Intent(class)

前端 未结 2 1124
清酒与你
清酒与你 2021-01-25 19:21

I\'m working on a code as a reference and encountered this Intent call: Intent(getApplicationContext(), secondActivity.class)

I got baffled because in my pr

2条回答
  •  庸人自扰
    2021-01-25 20:00

    "This provides a convenient way to create an intent that is intended to execute a hard-coded class name, rather than relying on the system to find an appropriate class for you." source: http://developer.android.com/reference/android/content/Intent.html#Intent%28android.content.Context,%20java.lang.Class%3C?%3E%29

提交回复
热议问题