Android intent syntax

前端 未结 2 586
半阙折子戏
半阙折子戏 2021-01-06 17:51

In my attempts to find out how to start a new intent in my app, I\'ve come across several ways of phrasing it.

This syntax returns a runtime error, namely a Activity

2条回答
  •  礼貌的吻别
    2021-01-06 18:18

    Please note, when you use "this" key word in "Intent in = new Intent(this, SomeActivity.class); " make sure you are not in a sub class of MainActivity this can set the wrong Activity as part of the Explicit intent Component.strong text

提交回复
热议问题