getActivity() where it is defined?

前端 未结 11 1959
温柔的废话
温柔的废话 2020-12-13 10:19

I\'m very new to android and I\'m following this example.

The code says we need to do these steps to get an dialog box:

AlertDialog.Builder builder =         


        
11条回答
  •  伪装坚强ぢ
    2020-12-13 10:39

    new AlertDialog.Builder() needs Context as input parameter. So try like

    AlertDialog.Builder builder = new AlertDialog.Builder(yourActivityName.this);
    

提交回复
热议问题