Android

Set maxLength of EditText dynamically

Posted on

Set maxLength of EditText dynamically At times you may want to set maxlength of EditText view dynamically. You’ve to use setFilters method of EditText, as shown below. EditText et = new EditText(this); int maxLength = 3; InputFilter[] FilterArray = new InputFilter[1]; FilterArray[0] = new InputFilter.LengthFilter(maxLength); et.setFilters(FilterArray); Hope it helps somebody…Cheers 🙂 You may be also interested in […]

Android

Invalid request. Missing the ‘origin’ parameter. Google Map directions request URL error

Posted on

Google Map Direction request API changed It seems Google Map Direction request API changed, which is used to get polyline points to draw drive path. Previously, I implemented drawing driving path on Map using below directions request. And this link worked perfectly, I used to get all the waypoints information, with it. https://maps.googleapis.com/maps/api/directions/json? waypoints=optimize:true|52.28582710000001,-1.1141665|52.2777244,-1.1581097& sensor=false but […]

Android

Display Menu items in ActionBar when using Fragment

Posted on

Display Menu items in Fragment ActionBar When Implementing Fragment screen, If it require to display Menu Items only specific to that Fragment screen. If you just write the following code… @Override public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { // TODO Auto-generated method stub super.onCreateOptionsMenu(menu, inflater); menu.clear(); inflater.inflate(R.menu.done_actions_menu, menu); } /** * On selecting action bar icons […]