Numeric password restriction means set automatic restriction so application user cannot enter alphabets, special characters as password. There are a automatic limitation applied on application's EditText box so user are unable to set alphabetic characters, special characters as passwords. It will allow the application to only open numeric keypad .
Setting up only numeric password enter restriction on android application.
Code for activity_main.xml file .
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.tutorials2make.getnumericpasswordandroidapp.MainActivity" >
<EditText
android:id="@+id/PasswordRestriction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:ems="10"
android:inputType="numberPassword" >
<requestFocus />
</EditText>
<Button
android:id="@+id/GetOnlyNumericPassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Get Only Numeric Password" />
</RelativeLayout>
Code for MainActivity.java programming file .
package com.tutorials2make.getnumericpasswordandroidapp;
import android.app.Activity;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class MainActivity extends Activity {
Editable HoldNumericPassword;
Button GetNumericPassword;
EditText GetNumericPasswordinAndroid;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
GetNumericPassword = (Button)findViewById(R.id.GetOnlyNumericPassword);
GetNumericPasswordinAndroid = (EditText)findViewById(R.id.PasswordRestriction);
GetNumericPassword.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
HoldNumericPassword = GetNumericPasswordinAndroid.getText();
Toast.makeText(MainActivity.this, HoldNumericPassword, Toast.LENGTH_LONG).show();
}
});
}
}
DAFTAR DAN AJAK TEMAN ANDA SEKARANG JUGA BERSAMA PALAPACASINO DISINI PUSAT NYA GAME LIVE CASINO link resmi > www,palapacasino,info WA+855 87983567
ReplyDelete~BONUS NEW MEMBER 10%
~BONUS HARIAN 10%
~BONUS CASHBACK 5%
~BONUS ROLLINGAN 0.8%
#livecasino #casinoonline #gameonline #casino #bacarat #roulette #blackjack #sicbo #hottable #terpercaya #indonesia #hoki