Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/180.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在访问firebase firestore时,android studio中是否有任何方法可以将集合引用从一个活动传递到另一个活动?_Android - Fatal编程技术网

在访问firebase firestore时,android studio中是否有任何方法可以将集合引用从一个活动传递到另一个活动?

在访问firebase firestore时,android studio中是否有任何方法可以将集合引用从一个活动传递到另一个活动?,android,Android,我需要在android studio中将我的集合引用从一个活动发送到另一个活动。在访问firebase firestore时,我是否可以将我的集合引用对象从一个活动发送到另一个活动 Intent intent = new Intent(CurrentActivity.this, NextActivity.class); intent.putExtra("referenceValue", collectionObject) // this way you can pass collection r

我需要在android studio中将我的集合引用从一个活动发送到另一个活动。在访问firebase firestore时,我是否可以将我的集合引用对象从一个活动发送到另一个活动

Intent intent = new Intent(CurrentActivity.this, NextActivity.class);
intent.putExtra("referenceValue", collectionObject) // this way you can pass collection reference by implementing Serializable
startActivity()
在nextractivity.class中

yourExpectedrefrence = (collectionClassName) 
getIntent().getExtras().getSerializable("referenceValue");

传递集合的路径,而不是集合本身。我可以将集合引用发送到另一个活动吗???您可以维护对引用的静态引用(DatabaseReference或StorageReference),并在所有活动中访问它。为什么首先要这样做?你不能在另一个活动上访问firebase吗?要访问静态引用,访问类必须是静态的??