Search code examples
androidandroid-appcompatappcompatactivity

Using a custom LayoutInflater.Factory with AppCompatDelegate


My custom factory isn't getting called in ActionbarActivity anymore with AppCompatDelegate as of v22.1.1.

I see in the docs that in this case you shouldn't call AppCompatDelegate.installFactory() (and a custom activity seems to support this) but if this is the case then I can't use AppCompatActivity/AppCompatDialog (and possibly the new builder?) or anything that inherits from those classes. So basically I need to reimplement the non-material versions (ie actionbar parts) of AppCompatActivity.

Is this actually the case or am I doing something wrong?


Solution

  • Using android.support.v4.view.LayoutInflaterCompat solves the problem.