![](/img/trans.png)
[英]Why strange naming convention of “AlertDialog.Builder” instead of “AlertDialogBuilder” in Android
[英]why Builder builder instead of alertdialoge.Builder?
我是android的新手並且被以下聲明擊中:
Builder builder = new AlertDialog.Builder(this);
但是,正如我們所知,Builder是AlertDialoge
類的靜態內部類,語句應該是:
AlertDialog.Builder builder= new Alertdialog.Builder(this);
因為你的import
語句。
我猜你有
import AlertDialog.Builder
在你的標題中。 您可以刪除此import
但是您必須將變量聲明為AlertDialog.Builder
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.