Following is the example of creating a RelativeLayout with different controls in android application.. Android - RelativeLayout programmatically. Posted by: admin Select your mobile device as an option and then check your mobile device which will display your default screen −. Why. RelativeLayout is a view group that displays child views in relative positions. ... Android set clickable text to go one fragment to another fragment. If LoginActivity is a fragment class then it would be okay is you use setOnClickListener on textview. How to programmatically take a screenshot in android? I use Android Emulator for a long time but I have some issues with it only during the last month. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. In this example we created dynamic view’s (ImageView and Button) programmatically in Java class.For creating views programmatically firstly we define the Relative Layout in our xml file and then add the code in java class to create ImageView and a Button one after another. Step 2 − Add the following code to res/layout/activity_main.xml. Android - RelativeLayout programmatically. How to disable ScrollView Programmatically in Android? ... Android set clickable text to go one fragment to another fragment. How to answer in incoming call programmatically in Android. How to set locale programmatically in android app? Finally we perform onClick event listener on … Here's XML: