您好我之前询问过有关使用Firebase数据库中的Base64显示图像的问题.建议使用firebase存储.我重新编写了代码,所有内容都加载到firebase存储和数据库中.我遇到的问题是当我保存数据时,没有任何内容填充到我的recyclerview中.一切都是空白的.
你可以提供给我这个工作的任何帮助都会很棒.谢谢.
编辑:在我的活动类中,我调用一个按钮clicklistener来激活相机.拍摄照片后,它将保存到Firebase存储.然后我从存储中下载图像并将其显示在recyclerview中.我理解上传部分,但我很难理解下载和显示部分.谢谢.
viewholder:绑定方法
public void bind (ImageProgress progress){
Glide.with(activity).load("").into(image);
}
}
Run Code Online (Sandbox Code Playgroud)
适配器
@Override
public ProgressViewHolder onCreateViewHolder(ViewGroup parent, int viewType){
return new ProgressViewHolder(activity, activity.getLayoutInflater().inflate(R.layout.weight_progress_list, parent, false));
Run Code Online (Sandbox Code Playgroud)
主要活动课
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.weight_progress);
saveButton = (Button) findViewById(R.id.saveButton);
progressStatusEditText = (EditText) findViewById(R.id.progressStatusEditText);
progressList = (RecyclerView) findViewById(R.id.progressList);
mImageButton = (ImageButton) findViewById(R.id.takePictureButton);
capturedImage=(ImageView)findViewById(R.id.capturedImageView);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
progressList.setHasFixedSize(false);
progressList.setLayoutManager(layoutManager);
//take picture button
mImageButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
openCamera();
}
});
mDatabaseReference = database.getReference("Progress");
saveButton.setOnClickListener(new View.OnClickListener() { …Run Code Online (Sandbox Code Playgroud) 嗨,我正在使用cordova开发混合应用程序.我试图使用CallLog插件访问在Android手机中错过的最后一个电话.这是我试过的,
1.I installed the plugin with this command cordova plugin add https://github.com/dalyc/Cordova-CallLog-Plugin.git.
2.I am using angularJS.I have this app.js.
var app=angular.module('lmp', ['ngCordova']);
app.controller('lmpctrl',['$scope', 'CallLogService', function($scope, CallLogService){
$scope.data = {};
$scope.callTypeDisplay = function(type) {
switch(type) {
case 1:
return 'Incoming';
case 2:
return 'Outgoing';
case 3:
return 'Missed';
default:
return 'Unknown';
}};
CallLogService.list(1).then(
function(callLog) {
console.log(callLog);
$scope.data.lastCall = callLog[0];
},
function(error) {
console.error(error);
});
}]);
app.factory('CallLogService', ['$q', function($q) {
return {
list : function(days) {
var q = $q.defer();
// days …Run Code Online (Sandbox Code Playgroud) 我目前有一个文本文件如下:
3 5 6 9
3 4 6 7 2
3 5 7 2 5 3
Run Code Online (Sandbox Code Playgroud)
读入java时的文件应显示为3x ^ 5 + 6x ^ 9.第二行将被读作4x ^ 4 + 6x ^ 7 + 2.由于我不知道如何将这些数字转换为该形式,因此无法让我的程序显示.当我运行程序时,我目前只得到它们之间有空格的数字.
这是我尝试过的:
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import javax.swing.JOptionPane;
public class Driver {
public static void main(String[] args) {
try {
@SuppressWarnings("resource")
Scanner myfile = new Scanner(new File("poly.dat"));
Polynomial[] mypolynomial;
mypolynomial = new Polynomial[10];
int index = 0;
if (myfile.hasNext() == true) { //ignore this part
myfile.nextLine();
} else …Run Code Online (Sandbox Code Playgroud)