CustomView based Android interview questions and answers
1) Design one custom view for displaying TextView in UI with a attributes tribute like Title and Colour. When we need to create any custom view in Android, we will extend our class from the View parent class. In this scenario, as we need to create a custom Text view so we will create a subclass of TextView class. And then we can our Custom textview in a layout.xml file. For example please follow below code where I am trying to create Custom TextView CustomTextView extends TextView { private String title; private boolean color; title = tarry.getString(R.styleable.CustomTextView_settitle); if(title == null) setText("Custom Message"); else setText("Welcome to the Class"); color = tarry.getBoolean(R.styleable. CustomTextView _setColor, false); if(color == true) setTextColor(Color.RED); } We need to define our custom textview in \res\layout folder and write the code like as shown below. &l