Combine declaration and initialization of variables. LayoutInflater inf = getLayoutInflater();