How to get hosting Activity from a view?
I have an Activity with 3 EditTexts and a custom view which acts a specialised keyboard to add information into the EditTexts. Currently … Read more
I have an Activity with 3 EditTexts and a custom view which acts a specialised keyboard to add information into the EditTexts. Currently … Read more
In an XML file, we can assign an ID to a view like android:id=”@+id/something” and then call findViewById(), but when creating a view … Read more
I’m writing a few custom views which share some same-named attributes. In their respective <declare-styleable> section in attrs.xml I’d like to use the … Read more
I’m a bit confused about the roles of forceLayout(), requestLayout() and invalidate() methods of the View class. When shall they be called? 6 … Read more
I’m trying to achieve the following programmatically (rather than declaratively via XML): <RelativeLayout…> <TextView … android:id=”@+id/label1″ /> <TextView … android:id=”@+id/label2″ android:layout_below: “@id/label1” /> … Read more
The LayoutInflater.inflate documentation isn’t exactly clear to me about the purpose of the attachToRoot parameter. attachToRoot: whether the inflated hierarchy should be attached … Read more
Before the AppCompat update came out today I was able to change the color of buttons in Android L but not on older … Read more
First of all: yes, I read all the other threads on this topic. And not only those from this site… (you see, I’m … Read more
I’m looking for an equivalent to addHeaderView for a recycler view. Basically I want to have an image with 2 buttons be added … Read more
I’m adding TextViews programmatically in a for-loop and add them to an ArrayList. How do I use TextView.setId(int id)? What Integer ID do … Read more