Skip to content

Commit ba3bbb9

Browse files
docs: update turbo-native-modules-android.md
The clear method was missing in the Java version and I added information to clean the build for possible errors.
1 parent b63b342 commit ba3bbb9

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

website/versioned_docs/version-0.80/turbo-native-modules-android.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ public class NativeLocalStorageModule extends NativeLocalStorageSpec {
5353
SharedPreferences sharedPref = getReactApplicationContext().getSharedPreferences("my_prefs", Context.MODE_PRIVATE);
5454
sharedPref.edit().remove(key).apply();
5555
}
56+
57+
@Override
58+
public void clear() {
59+
SharedPreferences sharedPref = getReactApplicationContext().getSharedPreferences("my_prefs", Context.MODE_PRIVATE);
60+
sharedPref.edit().clear().apply();
61+
}
5662
}
5763
```
5864

@@ -332,6 +338,12 @@ class MainApplication : Application(), ReactApplication {
332338
</TabItem>
333339
</Tabs>
334340

341+
Before building and running your code on an emulator, we recommend cleaning your Android build to avoid potential issues:
342+
343+
```bash
344+
cd android && ./gradlew clean
345+
```
346+
335347
You can now build and run your code on an emulator:
336348

337349
<Tabs groupId="package-manager" queryString defaultValue={constants.defaultPackageManager} values={constants.packageManagers}>

0 commit comments

Comments
 (0)