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

Procedure to ignore Screen Orientations(means to restrict Activity to not destroy and reCreate activity for every orientation change),in Android

add a couple of attributes in your manifest file 
        <activity  android:name=".blah" 
android:screenOrientation="portrait" 
        android:configChanges="orientation|keyboardHidden" /> 
and then override a method 
    @Override 
    public void onConfigurationChanged(Configuration newConfig) { 
      //ignore orientation change 
      super.onConfigurationChanged(newConfig); 
    } 
to ignore any orientation change. 

----------------------------------------OR--------------------------------


@Override
    public void onConfigurationChanged(Configuration newConfig) {
     super.onConfigurationChanged(newConfig);
     setContentView(R.layout.main);
     
     SetupActivity();
    }
    
    private void SetupActivity() {
     itemView = (ToDoItemView)findViewById(R.id.cstNote);
        itemView.setOnTouchListener(myTouch);
        
        if (points != null)
         itemView.setPoints(points);
        
        text = (EditText)findViewById(R.id.txtText);
        txtX = (EditText)findViewById(R.id.txtX);
        txtY = (EditText)findViewById(R.id.txtY);
        
        text.setOnKeyListener(myListener);        
        txtX.setOnKeyListener(myListener);        
        txtY.setOnKeyListener(myListener);
    }

Comments