Skip to main content

Featured

Android studio “SDK tools directory is missing”

Following 2 possible solutions will resolve this problem :  Solution1 : To fix the problem, it was required that I list the path to my corporate PAC file by using  Configure -> "Appearance and Behavior" -> System Settings -> HTTP Proxy . I selected "Automatic proxy configuration url:" Delete your  ~/.Android*  folders (losing all of your settings :/). Run Android Studio. It will show you a welcome wizard where it tries to download the SDK again (and fails due to my rubbish internet). Click the X on the wizard window. That will enable you to get to the normal welcome dialog. Go to Settings->Project Defaults->Project Structure and change the Android SDK location to the correct one. Solution 2 : To fix the problem, it was required that I list the path to my corporate PAC file by using  Configure -> "Appearance and Behavior" -> System Settings -> HTTP Proxy . I selected "Automatic proxy configuration url:&quo

Problem to resolve Error Popup not displaying for EditText Android

Here i have a special case to show that error popup for Editext ,
I have multiple expandable/collapse rows and each row having that expireDateEdittext EditText.

After expanding the row , initially EditText will just have only error icon inside it and not has Error popup .After clicking on it Date picker dialog need to display.

Here in my case after expanding row Error icon displaying properly But problem is Error Popup not displaying after clicking and setting the wrong date on it.
So, I thought its EditText focus problem after expanding the row.And i have fixed that issue using following process.

XML File : 

 <EditText
                android:id="@+id/expireDateEdittext"
                style="@style/EditText"
                android:layout_width="fill_parent"
                android:layout_height="@dimen/expireDateEdittext_height"
                android:editable="false"
                android:focusable="true"
                android:focusableInTouchMode="true"
                android:clickable="true"
                android:ems="10"
                android:text="@string/expireDateEdittext_text"
                android:paddingLeft="10dp" />


Java File :
expireDateEdittext.setEnabled(true);
expireDateEdittext.setFocusableInTouchMode(true);

expireDateEdittext.setError(getResources().getString(R.string.expiryDateError));

if (expireDateEdittext.requestFocus()) {
 ((PopupWindow) getWindowToken()).setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);
}


Got Refrence from following Site :
http://www.androidhive.info/2015/09/android-material-design-floating-labels-for-edittext/

Comments