我正在尝试通过从手机的图片库中选择图片来上传图片。但是选择它后根本不执行任何操作,甚至不上传它。
我已经尝试了干净的构建并重新构建仍然没有帮助。
它只是通过说出以下内容自动断开连接:
V / FA:正在进行连接尝试D / FA:已连接到远程服务V / FA:正在处理排队的服务任务:2 V / FA:不活动,正在与服务断开连接
public class MainActivity extends AppCompatActivity {
Button uploadButton;
ImageView downloadedImage;
private static final int CAMERA_REQUEST_CODE=1;
private StorageReference storageReference;
//private ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
uploadButton = findViewById(R.id.button);
downloadedImage = findViewById(R.id.imageView);
storageReference = FirebaseStorage.getInstance().getReference();
//progressDialog = new ProgressDialog(this);
uploadButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent,CAMERA_REQUEST_CODE);
Log.i("Done","Till here");
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode == CAMERA_REQUEST_CODE && requestCode == RESULT_OK)
{
Log.i("Not Done","This log is not visible");
我得到的错误是:
I / art:拒绝对先前失败的类java.lang.Class:java.lang.NoClassDefFoundError进行重新初始化:无法解决以下问题:Landroid / view / View $ OnUnhandledKeyEventListener;
隔江千里
相关分类