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

code to display Previously selected item on your AlertDialog list(here it Works like Spinner),in Android




//i used it in my ParkingHero,AddNewAddress.java file
AlertDialog alert;
    AlertDialog.Builder builder;
int indexState=-1;
String arrayStringState[] ;




// On click for State...
    public void addAddressStateOnClick(View v) {
        sharedVariables.imm.hideSoftInputFromWindow(
                editTextState.getWindowToken(), 0);
        sharedVariables.imm.hideSoftInputFromWindow(
                editTextState.getWindowToken(), 0);

        builder = new AlertDialog.Builder(AddNewAddress.this);
        builder.setTitle("Select State from List");
        builder.setSingleChoiceItems(arrayStringState, indexState,
                new DialogInterface.OnClickListener() {
           
           
                    public void onClick(DialogInterface dialog, int item) {                           
                       
                        String tempStr = arrayStringState[item];
                        stateStr = tempStr.substring(0, 2);
                        editTextState.setText(stateStr);
                        dialog.cancel();// to Hide the list
                        tempStr = null;
                       
                        indexState=item;
                        System.out.println("====indexState=="+indexState);
                    }
                });
        alert = builder.create();
        alert.show();
    }

Comments