AlertDialog.Builder のリファレンス ページには、API 11 以降のgetContext()メソッドがリストされていますが、このコードは次のとおりです。
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
LayoutInflater inflater = LayoutInflater.from(builder.getContext());
}
Eclipse でエラーが表示されます。
The method getContext() is undefined for the type AlertDialog.Builder
しかし、私は API レベル 15 を使用しているので、利用できると思っていたでしょう。誰が問題が何であるかを見ることができますか?