I am currently converting an xml file to java coding, but I have met a problem. In my xml file I have a View with two xmlns attributes like this :
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:launcher="http://schemas.android.com/apk/res/com.android.launcher"
How can I ad these to my custom FrameLayout in java?
The purpose of the
xmlnsattributes is to tell the design-time and build-time tools about the various UI elements such asButton,TextView,FrameLayoutetc.Simply importing the relevant widget and view classes if you’re writing Java code to build the layout dynamically is basically the equivalent. In other words, don’t worry about the
xmlnsattributes.