Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Context context;
- EditText EmployeeUserName,EmployeePassword;
- String username= "",password = "";
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- if (getSupportActionBar() != null )
- getSupportActionBar().hide();
- setContentView(R.layout.activity_login);
- context = LoginActivity.this;
- EmployeeUserName = (EditText) findViewById(R.id.EmployeeUserName);
- EmployeePassword = (EditText) findViewById(R.id.EmployeePassword);
- }
- public void onSignInClicked(View paramView) {
- Utility.hideSoftKeyboard(context,paramView);
- username = this.EmployeeUserName.getText().toString();
- password = this.EmployeePassword.getText().toString();
- if(username.isEmpty()){
- Utility.displayToast(this,"Please Enter Username");
- }else if(password.isEmpty()){
- Utility.displayToast(this,"Please Enter Password");
- }else{
- Log.d("internet ","internet : " + Utility.checkNetworkConnection(context));
- if(Utility.checkNetworkConnection(context) == true) {
- SharedPreferences.Editor editor = getSharedPreferences(ERPConstant.PREFS_NAME, 0).edit();
- editor.putString("USER_NAME", username);
- editor.putString("PASSWORD", password);
- editor.commit();
- Intent localIntent = new Intent(this, LanguageActivity.class);
- startActivity(localIntent);
- finish();
- return;
- }else{
- Utility.displayToast(this,getResources().getString(R.string.no_internet_connection));
- }
- }
- }
Add Comment
Please, Sign In to add comment