× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Android theme not used in library project

Xaver Kapeller
May 07, 2015
<p>The problem is that you are getting the <code>LayoutInflater</code> with <code>getSystemService()</code>. If you want the <code>LayoutInflater</code> to use a specific theme you have to create it from a <code>Context</code> which is using that theme. Usually that would be the <code>Context</code> from an <code>Activity</code> or from your <code>Application</code>. Try this instead:</p> <pre><code>LayoutInflater inflater = LayoutInflater.from(context); </code></pre> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/30022991/Android%20theme%20not%20used%20in%20library%20project/30023876">Stack Overflow</a>.</p>

Get New Tutorials Delivered to Your Inbox

New tutorials will be sent to your Inbox once a week.

comments powered by Disqus