Skip to content

Commit 6f6d174

Browse files
authored
Separate declare from init (firebase#276)
1 parent d017a0c commit 6f6d174

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

database/app/src/main/java/com/google/firebase/referencecode/database/ReadAndWriteSnippets.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ public class ReadAndWriteSnippets {
2323

2424
private static final String TAG = "ReadAndWriteSnippets";
2525

26-
// [START initialize_database_ref]
26+
// [START declare_database_ref]
2727
private DatabaseReference mDatabase;
28-
// ...
29-
// [START_EXCLUDE]
28+
// [END declare_database_ref]
29+
3030
public ReadAndWriteSnippets(DatabaseReference database) {
31-
// [END_EXCLUDE]
32-
mDatabase = FirebaseDatabase.getInstance().getReference();
33-
// [END initialize_database_ref]
31+
// [START initialize_database_ref]
32+
mDatabase = FirebaseDatabase.getInstance().getReference();
33+
// [END initialize_database_ref]
3434
}
3535

3636
// [START rtdb_write_new_user]

database/app/src/main/java/com/google/firebase/referencecode/database/kotlin/ReadAndWriteSnippets.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ abstract class ReadAndWriteSnippets {
1717

1818
private val TAG = "ReadAndWriteSnippets"
1919

20-
// [START initialize_database_ref]
20+
// [START declare_database_ref]
2121
private lateinit var database: DatabaseReference
22-
// ...
23-
// [START_EXCLUDE]
22+
// [END declare_database_ref]
23+
2424
fun initializeDbRef() {
25-
// [END_EXCLUDE]
26-
database = Firebase.database.reference
27-
// [END initialize_database_ref]
25+
// [START initialize_database_ref]
26+
database = Firebase.database.reference
27+
// [END initialize_database_ref]
2828
}
2929

3030
// [START rtdb_write_new_user]

0 commit comments

Comments
 (0)