LoginSignup
8
10

More than 5 years have passed since last update.

FragmentでgetLayoutInflater();がエラーな時

Last updated at Posted at 2015-03-12

LayoutInflater inflater = getLayoutInflater();
とFragentで書いてみたけど、エラーになってしまった時

だいたいこの4つに書き直す事で対処出来そう。
stackoverfLowを参考にしました・

①getActivity().getLayoutInflater();

②layoutInflater.from(getActivity());

③View.inflate();

④LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

8
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
10