1

Error:(58, 13) Failed to resolve: com.android.support:support-v4-preferencefragment:1.0.0 Install Repository and sync project
Show in File
Show in Project Structure dialog

public class PreferencesActivity extends BaseActivity {

    @Override
    protected void onCreate( Bundle savedInstanceState ) {
        super.onCreate(savedInstanceState);
        Fragment preferencesFragment = new PreferencesFragment();
        U.attachFragment(this, preferencesFragment);
    }

    @Override
    protected int getLayoutResourceId() {
        return R.layout.activity_fragment;
    }

    @Override
    protected Boolean isChildActivity() {
        return true;
    }

    @Override
    protected String getActivityTag() {
        return Config.ACTIVITY_TAG_PREFERENCES;
    }

    @Override public void onConfigurationChanged( Configuration newConfig ) {
        super.onConfigurationChanged(newConfig);
        Fragment preferencesFragment = new PreferencesFragment();
        U.attachFragment(this, preferencesFragment);
    }
}

why this source is appear error? please solve my problem

Expolk
  • 23
  • 6

2 Answers2

1

android.support.v4.preference.PreferenceFragment is a library project that you can use in your own project, you just need to download the source(zip). The reason you're getting this error is because you're probably trying to load it in with just a gradle dependency. This answer shows you detailed steps on how to load a library project into your own project.

Community
  • 1
  • 1
methodMan
  • 629
  • 2
  • 11
  • 27
0

Try to install your appcompat v4 and then restart the studio. It helps

Surya
  • 628
  • 3
  • 9
  • 26