AndroidManifest.xml file
Code inside src/main/AndroidManifest.xml file would look like below.
xml
<? xml version="1.0" encoding="utf-8"?> < manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.w3wiki.dynamicedittextkotlin"> < application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> < activity android:name=".MainActivity"> < intent-filter > < action android:name="android.intent.action.MAIN" /> < category android:name="android.intent.category.LAUNCHER" /> </ intent-filter > </ activity > </ application > </ manifest > |
Dynamic EditText in Kotlin
EditText is used to get input from the user. EditText is commonly used in login or registration screens. we already learn how to create an EditText using layout. In this article, we will learn about how to create android EditText programmatically in kotlin. At first, we will create a new android application. Then, we will create an EditText dynamically. If you already created the project then ignore step 1.1. Create New Project
Step | Description |
---|---|
1. | Open Android Studio. |
2. | Go to File => New => New Project. |
3. | Then, select Empty Activity and click on next |
4. | 1.Write application name as DynamicEditTextKotlin 2. Select minimum SDK as you need, here we have selected 21 as minimum SDK 3. Choose language as Kotlin and click on finish button. |
5. | If you have followed above process correctly, you will get a newly created project successfully. |
After creating project we will modify xml files then.