Skip to content

Commit 0c308e7

Browse files
committed
Refactor: Fix warnings
1 parent 17f3a41 commit 0c308e7

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

app/src/main/java/me/zhanghai/android/textselectionwebsearch/EditTextPreferenceCompat.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import androidx.annotation.Nullable;
1212
import androidx.annotation.StyleRes;
1313

14+
@SuppressWarnings("deprecation")
1415
public class EditTextPreferenceCompat extends EditTextPreference {
1516

1617
private boolean mTextSetCompat;

app/src/main/java/me/zhanghai/android/textselectionwebsearch/SettingsActivity.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
public class SettingsActivity extends PreferenceActivity
2222
implements SharedPreferences.OnSharedPreferenceChangeListener {
2323

24-
@NonNull
2524
private Preference mCustomSearchEngineUrlFormatPreference;
2625

2726
@Override
@@ -43,7 +42,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
4342

4443
@Override
4544
public void onSharedPreferenceChanged(@NonNull SharedPreferences sharedPreferences,
46-
@NonNull String key) {
45+
@Nullable String key) {
4746
if (Objects.equals(key, getString(R.string.pref_key_search_engine))) {
4847
updateCustomSearchEngineUrlFormatPreferenceVisibility();
4948
}

app/src/main/java/me/zhanghai/android/textselectionwebsearch/WebSearchActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ private SharedPreferences getSharedPreferences() {
141141
}
142142

143143
@NonNull
144+
@SuppressWarnings("deprecation")
144145
private static SharedPreferences getSharedPreferences(@NonNull Context context) {
145146
return PreferenceManager.getDefaultSharedPreferences(context);
146147
}

0 commit comments

Comments
 (0)