showDialog deprecated. What's the alternative?

前端 未结 5 1823
猫巷女王i
猫巷女王i 2020-12-12 15:17

Is there something else that should be called?

showDialog(TIME_DIALOG_ID);

It\'s in this tutorial but says deprecated in Eclipse.<

5条回答
  •  隐瞒了意图╮
    2020-12-12 15:51

    This code worked for me. Easy fix but probably not a preferred way.

    public void onClick (View v) {
        createdDialog(0).show(); // Instead of showDialog(0);
    }
    
    protected Dialog createdDialog(int id) {
        // Your code
    }
    

提交回复
热议问题