Android get activity from within anonymous class

前端 未结 2 2116
南方客
南方客 2020-12-17 19:00

I\'m super new to Android development and Java in general. Here\'s the basic setup: I have a splash screen with an AsyncTask to check server availability. Follo

2条回答
  •  粉色の甜心
    2020-12-17 19:15

    If The activity that you use Called "MyActivity" then you can do the following:

    MyActivity.this
    

    This chunk of code will return the this "current" object of outer class

提交回复
热议问题