List of usage examples for android.text InputType TYPE_NULL
int TYPE_NULL
To view the source code for android.text InputType TYPE_NULL.
Click Source Link
From source file:org.tasks.activities.TagSettingsActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tag_settings_activity); ButterKnife.bind(this); tagData = getIntent().getParcelableExtra(EXTRA_TAG_DATA); if (tagData == null) { isNewTag = true;/*from w ww . j a v a2 s. c o m*/ tagData = new TagData(); tagData.setUUID(UUIDHelper.newUUID()); } if (savedInstanceState == null) { selectedTheme = tagData.getColor(); } else { selectedTheme = savedInstanceState.getInt(EXTRA_SELECTED_THEME); } final boolean backButtonSavesTask = preferences.backButtonSavesTask(); toolbar.setTitle(isNewTag ? getString(R.string.new_tag) : tagData.getName()); toolbar.setNavigationIcon(ContextCompat.getDrawable(this, backButtonSavesTask ? R.drawable.ic_close_24dp : R.drawable.ic_save_24dp)); toolbar.setNavigationOnClickListener(v -> { if (backButtonSavesTask) { discard(); } else { save(); } }); toolbar.inflateMenu(R.menu.menu_tag_settings); toolbar.setOnMenuItemClickListener(this); toolbar.showOverflowMenu(); color.setInputType(InputType.TYPE_NULL); name.setText(tagData.getName()); String autopopulateName = getIntent().getStringExtra(TOKEN_AUTOPOPULATE_NAME); if (!isEmpty(autopopulateName)) { name.setText(autopopulateName); getIntent().removeExtra(TOKEN_AUTOPOPULATE_NAME); } else if (isNewTag) { toolbar.getMenu().findItem(R.id.delete).setVisible(false); name.requestFocus(); InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.showSoftInput(name, InputMethodManager.SHOW_IMPLICIT); } updateTheme(); }
From source file:com.scigames.slidegame.Registration2RFIDActivity.java
/** Called with the activity is first created. */ @Override/*from w ww. ja va 2s. c o m*/ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d(TAG, "super.OnCreate"); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); Intent i = getIntent(); Log.d(TAG, "getIntent"); visitIdIn = i.getStringExtra("visitId"); studentIdIn = i.getStringExtra("studentId"); firstNameIn = i.getStringExtra("fName"); lastNameIn = i.getStringExtra("lName"); //classIdIn = i.getStringExtra("mClass"); //passwordIn = i.getStringExtra("mPass"); Log.d(TAG, "...getStringExtra:"); //Log.d(TAG,firstNameIn+lastNameIn); // Inflate our UI from its XML layout description. setContentView(R.layout.registration2_rfid); Log.d(TAG, "...setContentView: registration2_rfid"); // Find the text editor view inside the layout, because we // want to do various programmatic things with it. braceletId = (EditText) findViewById(R.id.bracelet_id); /* to hide the keyboard on launch, then open when tap in firstname field */ Log.d(TAG, "...braceletId EditText set"); braceletId.setInputType(InputType.TYPE_NULL); Log.d(TAG, "...setInputType"); braceletId.setOnTouchListener(new View.OnTouchListener() { //@Override public boolean onTouch(View v, MotionEvent event) { braceletId.setInputType(InputType.TYPE_CLASS_TEXT); braceletId.onTouchEvent(event); // call native handler return true; // consume touch even } }); //firstName = (EditText) findViewById(R.id.first_name); //lastName = (EditText) findViewById(R.id.last_name); //password = (EditText) findViewById(R.id.password); Log.d(TAG, "...instantiateEditTexts"); // Log.d(TAG,"firstNameIn:"); // Log.d(TAG,firstNameIn); // Log.d(TAG,"lastNameIn:"); // Log.d(TAG,lastNameIn); //set info to what we know already //lastName.setText(lastNameIn); // Log.d(TAG,"...lastName.setText"); //firstName.setText(firstNameIn); // Log.d(TAG,"...firstName.setText"); //display name in greeting sentence Resources res = getResources(); TextView greets = (TextView) findViewById(R.id.greeting); Log.d(TAG, "...TextView greets find greeting"); greets.setText(String.format(res.getString(R.string.greeting), firstNameIn, lastNameIn)); Log.d(TAG, greets.toString()); Log.d(TAG, "...Greetings"); // Hook up button presses to the appropriate event handler. ((Button) findViewById(R.id.back)).setOnClickListener(mBackListener); ((Button) findViewById(R.id.continue_button)).setOnClickListener(mContinueButtonListener); ((Button) findViewById(R.id.scan)).setOnClickListener(mScanButtonListener); Log.d(TAG, "...instantiateButtons"); task.setOnResultsListener(this); }
From source file:org.videolan.vlc.gui.dialogs.PickTimeFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.jump_to_time, container); ((TextView) view.findViewById(R.id.jump_dialog_title)).setText(getTitle()); mHours = (EditText) view.findViewById(R.id.jump_hours); mMinutes = (EditText) view.findViewById(R.id.jump_minutes); mSeconds = (EditText) view.findViewById(R.id.jump_seconds); mMillis = (EditText) view.findViewById(R.id.jump_millis); mActionButton = (Button) view.findViewById(R.id.jump_go); mSign = (TextView) view.findViewById(R.id.jump_sign); mMinutes.setOnFocusChangeListener(this); mSeconds.setOnFocusChangeListener(this); mMinutes.setOnEditorActionListener(this); mSeconds.setOnEditorActionListener(this); mActionButton.setOnClickListener(this); mActionButton.setOnFocusChangeListener(this); mTextColor = mMinutes.getCurrentTextColor(); view.findViewById(R.id.jump_minutes_up).setOnClickListener(this); view.findViewById(R.id.jump_minutes_down).setOnClickListener(this); view.findViewById(R.id.jump_seconds_up).setOnClickListener(this); view.findViewById(R.id.jump_seconds_down).setOnClickListener(this); if (BuildConfig.tv) { mHours.setInputType(InputType.TYPE_NULL); mMinutes.setInputType(InputType.TYPE_NULL); mSeconds.setInputType(InputType.TYPE_NULL); mMillis.setInputType(InputType.TYPE_NULL); mHours.setOnClickListener(this); mMinutes.setOnClickListener(this); mSeconds.setOnClickListener(this); mMillis.setOnClickListener(this); }//from w ww . j a v a 2 s . c o m getDialog().setOnKeyListener(this); getDialog().setCancelable(true); getDialog().setCanceledOnTouchOutside(true); Window window = getDialog().getWindow(); window.setBackgroundDrawableResource(Util.getResourceFromAttribute(getActivity(), R.attr.rounded_bg)); window.setLayout(WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT); return view; }
From source file:com.scigames.slidegame.Registration1UserNameActivity.java
/** Called with the activity is first created. */ @Override/*from w ww .ja va 2 s .com*/ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d(TAG, "super.OnCreate"); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); Intent i = getIntent(); Log.d(TAG, "...getIntent"); // firstNameIn = i.getStringExtra("fName"); // lastNameIn = i.getStringExtra("lName"); // studentIdIn = i.getStringExtra("studentId"); // visitIdIn = i.getStringExtra("visitId"); Log.d(TAG, "...getStringExtra"); // Inflate our UI from its XML layout description. setContentView(R.layout.registration1_username); Log.d(TAG, "...setContentView"); // Find the text editor view inside the layout, because we // want to do various programmatic things with it. firstName = (EditText) findViewById(R.id.first_name); /* to hide the keyboard on launch, then open when tap in firstname field */ firstName.setInputType(InputType.TYPE_NULL); firstName.setOnTouchListener(new View.OnTouchListener() { //@Override public boolean onTouch(View v, MotionEvent event) { firstName.setInputType(InputType.TYPE_TEXT_VARIATION_PERSON_NAME); firstName .setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); firstName.onTouchEvent(event); // call native handler return true; // consume touch even } }); lastName = (EditText) findViewById(R.id.last_name); password = (EditText) findViewById(R.id.password); Log.d(TAG, "...instantiateEditTexts"); // Hook up button presses to the appropriate event handler. ((Button) findViewById(R.id.back)).setOnClickListener(mBackListener); //((Button) findViewById(R.id.clear)).setOnClickListener(mClearListener); ((Button) findViewById(R.id.continue_button)).setOnClickListener(mContinueButtonListener); Log.d(TAG, "...instantiateButtons"); //set info to what we know already //firstName.setText(firstNameIn); //lastName.setText(lastNameIn); //password.setText(passwordIn); //Log.d(TAG,"...setTexts with incoming name/pw"); //set listener task.setOnResultsListener(this); alertDialog = new AlertDialog.Builder(Registration1UserNameActivity.this).create(); // Setting Dialog Title alertDialog.setTitle("Login Failed"); // Setting Dialog Message alertDialog.setMessage("Welcome to AndroidHive.info"); // Setting Icon to Dialog //alertDialog.setIcon(R.drawable.tick); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // Write your code here to execute after dialog closed Toast.makeText(getApplicationContext(), "You clicked on OK", Toast.LENGTH_SHORT).show(); } }); }
From source file:com.scigames.registration.Registration1UserNameActivity.java
/** Called with the activity is first created. */ @Override/*from w ww . j a v a 2 s . c om*/ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d(TAG, "super.OnCreate"); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); Intent i = getIntent(); Log.d(TAG, "...getIntent"); firstNameIn = i.getStringExtra("fName"); lastNameIn = i.getStringExtra("lName"); passwordIn = i.getStringExtra("pword"); Log.d(TAG, "...getStringExtra"); // Inflate our UI from its XML layout description. setContentView(R.layout.registration1_username); Log.d(TAG, "...setContentView"); lastName = (EditText) findViewById(R.id.last_name); password = (EditText) findViewById(R.id.password); password_confirm = (EditText) findViewById(R.id.confirm_password); firstName = (EditText) findViewById(R.id.first_name); /* to hide the keyboard on launch, then open when tap in firstname field */ firstName.setCursorVisible(false); firstName.setInputType(InputType.TYPE_NULL); firstName.setOnTouchListener(new View.OnTouchListener() { //@Override public boolean onTouch(View v, MotionEvent event) { firstName.setInputType(InputType.TYPE_TEXT_VARIATION_PERSON_NAME); firstName .setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); firstName.setCursorVisible(true); firstName.onTouchEvent(event); // call native handler return true; // consume touch even } }); Log.d(TAG, "...instantiateEditTexts"); // Hook up button presses to the appropriate event handler. ((Button) findViewById(R.id.continue_button)).setOnClickListener(mContinueButtonListener); Log.d(TAG, "...instantiateButtons"); Typeface ExistenceLightOtf = Typeface.createFromAsset(getAssets(), "fonts/Existence-Light.ttf"); Typeface Museo300Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo300-Regular.otf"); Typeface Museo500Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo500-Regular.otf"); Typeface Museo700Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo700-Regular.otf"); setEditTextFont(Museo500Regular, firstName, lastName, password, password_confirm); //set info to what we know already firstName.setText(firstNameIn); lastName.setText(lastNameIn); //password.setText(passwordIn); Log.d(TAG, "...setTexts with incoming name/pw"); //set listener task.setOnResultsListener(this); alertDialog = new AlertDialog.Builder(Registration1UserNameActivity.this).create(); // Setting Dialog Title alertDialog.setTitle("Login Failed"); // Setting Dialog Message alertDialog.setMessage("Welcome to AndroidHive.info"); // Setting Icon to Dialog //alertDialog.setIcon(R.drawable.tick); alertDialog.setButton(RESULT_OK, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // Write your code here to execute after dialog closed Toast.makeText(getApplicationContext(), "", Toast.LENGTH_SHORT).show(); } }); }
From source file:com.scigames.registration.LoginActivity.java
/** Called with the activity is first created. */ @Override/*from ww w .ja v a 2 s.com*/ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); //getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION ); // View v = findViewById(R.layout.login_page); // v.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); //Window w = this.getWindow(); // in Activity's onCreate() for instance //w.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, // WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.login_page); Log.d(TAG, "super.OnCreate"); // Inflate our UI from its XML layout description. // Intent i = getIntent(); // if (i.hasExtra("token")){ // setContentView(R.layout.login_page); // } else { // setContentView(R.layout.no_device); // } lastName = (EditText) findViewById(R.id.last_name); password = (EditText) findViewById(R.id.password); classId = (EditText) findViewById(R.id.class_id); firstName = (EditText) findViewById(R.id.first_name); /* to hide the keyboard on launch, then open when tap in firstname field */ //firstName.setActivated(false); //firstName.setSelected(false); firstName.setCursorVisible(false); firstName.setInputType(InputType.TYPE_NULL); firstName.setOnTouchListener(new View.OnTouchListener() { //@Override public boolean onTouch(View v, MotionEvent event) { firstName.setInputType(InputType.TYPE_TEXT_VARIATION_PERSON_NAME); firstName .setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); firstName.setCursorVisible(true); firstName.onTouchEvent(event); // call native handler return true; // consume touch even } }); //for faster testing: // firstName.setText("joseph7"); // lastName.setText("christopher"); // password.setText("qweasd"); // classId.setText("66"); // // Hook up button presses to the appropriate event handler. ((Button) findViewById(R.id.login_button)).setOnClickListener(mLogInListener); ((Button) findViewById(R.id.register)).setOnClickListener(mRegisterListener); //set listener task.setOnResultsListener(this); alertDialog = new AlertDialog.Builder(LoginActivity.this).create(); // Setting Dialog Title alertDialog.setTitle("Login Failed"); // Setting Dialog Message alertDialog.setMessage("Welcome to AndroidHive.info"); // Setting Icon to Dialog //alertDialog.setIcon(R.drawable.tick); alertDialog.setButton(RESULT_OK, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // Write your code here to execute after dialog closed Toast.makeText(getApplicationContext(), "Check your login info!", Toast.LENGTH_SHORT).show(); } }); Typeface ExistenceLightOtf = Typeface.createFromAsset(getAssets(), "fonts/Existence-Light.ttf"); Typeface Museo300Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo300-Regular.otf"); Typeface Museo500Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo500-Regular.otf"); Typeface Museo700Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo700-Regular.otf"); // TextView welcome = (TextView)findViewById(R.id.welcome); TextView notascigamersentence = (TextView) findViewById(R.id.notascigamersentence); // setTextViewFont(ExistenceLightOtf, welcome); setTextViewFont(Museo500Regular, notascigamersentence); setEditTextFont(Museo500Regular, firstName, lastName, password, classId); login = (Button) findViewById(R.id.login_button); register = (Button) findViewById(R.id.register); /* out for now */ setButtonFont(ExistenceLightOtf, login, register); setButtonFont(Museo500Regular, register); // if (getIntent().getBooleanExtra("EXIT", false)) { // finish(); // } }
From source file:com.example.parking.InputLicenseActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mDBAdapter = new DBAdapter(this); Intent intent = getIntent();//from w w w .jav a 2 s . com Bundle bundle = intent.getExtras(); if (bundle.getInt("type") == ARRIVING_TYPE) { mType = ARRIVING_TYPE; } else if (bundle.getInt("type") == LEAVING_TYPE) { mType = LEAVING_TYPE; } setContentView(R.layout.activity_input_license); mLicensePlateET = (EditText) findViewById(R.id.et_license_plate); mLetterTV = (TextView) findViewById(R.id.tv_letter); mNumberTV = (TextView) findViewById(R.id.tv_number); mLocationTV = (TextView) findViewById(R.id.tv_location); mScanBT = (Button) findViewById(R.id.bt_scan); mNextBT = (Button) findViewById(R.id.bt_next); mLetterTV.setOnClickListener(mTabClickListener); mNumberTV.setOnClickListener(mTabClickListener); mLocationTV.setOnClickListener(mTabClickListener); changeSelect(R.id.tv_location); changeFragment(R.id.tv_location); mLicensePlateET.setOnTouchListener(new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { // et.getCompoundDrawables()4? Drawable drawable = mLicensePlateET.getCompoundDrawables()[2]; //???? if (drawable == null) return false; //???? if (event.getAction() != MotionEvent.ACTION_UP) return false; if (event.getX() > mLicensePlateET.getWidth() - mLicensePlateET.getPaddingRight() - drawable.getIntrinsicWidth()) { mLicensePlateET.setText(""); } return false; } }); mScanBT.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { Message msg = new Message(); msg.what = EVENT_SCAN_STATE_NOTIFY; mHandler.sendMessage(msg); } }); mLicensePlateET.setInputType(InputType.TYPE_NULL); mLicensePlateET.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, int start, int before, int count) { if (mLicensePlateET.getText() != null && mLicensePlateET.getText().length() > LICENSE_PLATE_NUMBER_SIZE) { Message msg = new Message(); msg.what = EVENT_INVALID_LICENSE_PLATE; mHandler.sendMessage(msg); } } @Override public void afterTextChanged(Editable s) { // TODO Auto-generated method stub } }); mNextBT.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { if (mLicensePlateET.getText().length() != LICENSE_PLATE_NUMBER_SIZE) { Message msg = new Message(); msg.what = EVENT_INVALID_LICENSE_PLATE; mHandler.sendMessage(msg); return; } new SQLThread().start(); } }); getActionBar().setDisplayHomeAsUpEnabled(true); IntentFilter filter = new IntentFilter(); filter.addAction("ExitApp"); filter.addAction("BackMain"); registerReceiver(mReceiver, filter); }
From source file:com.anyonavinfo.commonuserregister.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_user_info); ButterKnife.inject(this); Utils util = new Utils(MainActivity.this); registerReceiver();/**/ edittext_birth.setInputType(InputType.TYPE_NULL); /*??*/ /* //?ArrayAdapter? adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, m); ////from w w w . ja va2s . com adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //adapter spinner edittext_userVehicleType.setAdapter(adapter); // Spinner? edittext_userVehicleType.setOnItemSelectedListener(new SpinnerSelectedListener()); // edittext_userVehicleType.setVisibility(View.VISIBLE);*/ orgId = edittext_userOrgId.getText().toString(); getSimInfo(this); }
From source file:ro.expectations.expenses.ui.categories.EditCategoryFragment.java
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mCategoryName = (TextInputEditText) view.findViewById(R.id.category_name); mCategoryName.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override/* www . j a v a 2 s . c o m*/ public void onFocusChange(View v, boolean hasFocus) { if (!hasFocus) { mCurrentCategory.setName(mCategoryName.getText().toString()); } } }); mCategoryParent = (TextInputEditText) view.findViewById(R.id.category_parent); mCategoryParent.setInputType(InputType.TYPE_NULL); mCategoryParent.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { CategoryPickerDialogFragment categoryPickerDialogFragment = CategoryPickerDialogFragment .newInstance(mCategoryId); categoryPickerDialogFragment.setTargetFragment(EditCategoryFragment.this, CATEGORY_PICKER_DIALOG_REQUEST_CODE); categoryPickerDialogFragment.show(getFragmentManager(), "category_picker"); } }); }
From source file:uk.ac.hutton.ics.buntata.activity.LogDetailsActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ButterKnife.bind(this); Bundle args = getIntent().getExtras(); if (args != null) { datasourceId = args.getInt(PARAM_DATASOURCE_ID, -1); nodeId = args.getInt(PARAM_NODE_ID, -1); logId = args.getInt(PARAM_LOG_ID, -1); }/*from w ww . j a v a 2 s .c om*/ setSupportActionBar(toolbar); DatasourceManager datasourceManager = new DatasourceManager(this, datasourceId); NodeManager nodeManager = new NodeManager(this, datasourceId); imageManager = new LogEntryImageManager(this); logManager = new LogEntryManager(this); log = logManager.getById(logId); if (log == null) { BuntataNodeAdvanced node = nodeManager.getById(nodeId); log = new LogEntry(); log.setDatasourceId(datasourceId); log.setNodeId(node.getId()); log.setNodeName(node.getName()); /* If this is a new entry, then definitely ask to save */ unsavedChanges = true; } datasource.setText(datasourceManager.getById(log.getDatasourceId()).getName()); nodeName.setText(nodeManager.getById(log.getNodeId()).getName()); latitude.setFilters(new InputFilter[] { new InputFilterMinMax(-90, 90) }); longitude.setFilters(new InputFilter[] { new InputFilterMinMax(-180, 180) }); note.setText(log.getNote()); if (log.getLatitute() != null) latitude.setText(DECIMAL_FORMAT.format(log.getLatitute())); if (log.getLongitude() != null) longitude.setText(DECIMAL_FORMAT.format(log.getLongitude())); datasource.setInputType(InputType.TYPE_NULL); nodeName.setInputType(InputType.TYPE_NULL); gpsButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { startLocationTracking(); } }); latitude.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean b) { if (!b) { try { double newValue = Double.parseDouble(latitude.getText().toString()); if (log.getLatitute() == null || log.getLatitute() != newValue) { log.setLatitute(newValue); unsavedChanges = true; } } catch (Exception e) { } } } }); longitude.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean b) { if (!b) { try { double newValue = Double.parseDouble(longitude.getText().toString()); if (log.getLongitude() == null || log.getLongitude() != newValue) { log.setLongitude(newValue); unsavedChanges = true; } } catch (Exception e) { } } } }); note.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean b) { if (!b) { String newText = note.getText().toString(); if (!StringUtils.areEqual(newText, log.getNote())) { log.setNote(newText); unsavedChanges = true; } } } }); GoogleAnalyticsUtils.trackEvent(this, getTracker(TrackerName.APP_TRACKER), getString(R.string.ga_event_category_log), getString(R.string.ga_event_action_node_view), log.getNodeName()); /* Set the toolbar as the action bar */ if (getSupportActionBar() != null) { /* Set the title */ getSupportActionBar().setTitle(log == null ? getString(R.string.log_add_title) : log.getNodeName()); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setHomeButtonEnabled(true); } updateImageSection(); }