Runtime error: cannot find the an activity to launch the intent. I am trying to view and retrieve my pdf documents stored on FirebaseStorage
Runtime error: cannot find the an activity to launch the intent. I am trying to view and retrieve my pdf documents stored on FirebaseStorage
这是我的 java 代码,我收到一条错误消息,提示未找到 activity 打开 intent。
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
//getting the upload
Upload upload = uploadList.get(i);
//Opening the upload file in browser using the upload url
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(upload.getUrl()));
startActivity(intent);
}
});
有人可以帮忙吗?下面是获取 url 并存储在 firebaseDatabase 中的代码,似乎也有问题..
Upload upload = new Upload(editTextFilename.getText().toString(), taskSnapshot.getStorage().getDownloadUrl().toString());
mDatabaseReference.child(mDatabaseReference.push().getKey()).setValue(upload);
https://firebase.google.com/docs/android/setup
老实说,有很多步骤要做,但请先按照上面的 link 指南完成第一步,首先创建一个数据库来存储您的数据,以便您可以继续下一步通过编码出您在上面陈述的所需功能。
我强烈建议您完整阅读并理解 select 的数据类型,了解您要在数据库示例中存储的内容,例如 String、Int、Double 等。更好地理解基础知识将减少您的瓶颈编码进度。
我在大学期间的最后一年项目中也曾经是 kotlin 和 firebase 的新手。那时候和现在相比,没有太多的解决方案。
至于上传文件等功能,也许这个视频可以作为上传图片的第一步:
https://www.youtube.com/watch?v=GmpD2DqQYVk&ab_channel=Foxandroid
这是我的 java 代码,我收到一条错误消息,提示未找到 activity 打开 intent。
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
//getting the upload
Upload upload = uploadList.get(i);
//Opening the upload file in browser using the upload url
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(upload.getUrl()));
startActivity(intent);
}
});
有人可以帮忙吗?下面是获取 url 并存储在 firebaseDatabase 中的代码,似乎也有问题..
Upload upload = new Upload(editTextFilename.getText().toString(), taskSnapshot.getStorage().getDownloadUrl().toString());
mDatabaseReference.child(mDatabaseReference.push().getKey()).setValue(upload);
https://firebase.google.com/docs/android/setup
老实说,有很多步骤要做,但请先按照上面的 link 指南完成第一步,首先创建一个数据库来存储您的数据,以便您可以继续下一步通过编码出您在上面陈述的所需功能。
我强烈建议您完整阅读并理解 select 的数据类型,了解您要在数据库示例中存储的内容,例如 String、Int、Double 等。更好地理解基础知识将减少您的瓶颈编码进度。
我在大学期间的最后一年项目中也曾经是 kotlin 和 firebase 的新手。那时候和现在相比,没有太多的解决方案。
至于上传文件等功能,也许这个视频可以作为上传图片的第一步: https://www.youtube.com/watch?v=GmpD2DqQYVk&ab_channel=Foxandroid