Intent to resume a previously paused activity (Called from a Notification)

后端 未结 5 1499
自闭症患者
自闭症患者 2020-12-25 15:05

I\'m developing an app which shows a notification to the user. The notification\'s objective is to make it easy to the user to return to the activity when the user is in ano

5条回答
  •  眼角桃花
    2020-12-25 15:14

    When creating your PendingIntent, you use:

    Main.this.getBaseContext()

    You should use the default Activity context if you want to return to the same activity. Read more here:

    Android - what's the difference between the various methods to get a Context?

提交回复
热议问题