编译错误= multipartentitybuilder()不公开,不能从外部程序包中访问
问题描述:
你能帮我找出下面的错误是什么意思吗?我不知道为什么我不能在包装外面访问它,我的意思是我应该使用哪种ACCESS SPECIFIER? 我尝试使用静态和所有说明符,但仍然无法摆脱此错误。当用户使用相机将图片上传到服务器时,我一直在使用它。编译错误= multipartentitybuilder()不公开,不能从外部程序包中访问
public class Logistic_ReportProblem extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_reportproblem);
context = this;
thisActivity = this;
assetsPropertyReader = new AssetsPropertyReader(context);
p = assetsPropertyReader.getProperties("tapp.properties");
url1 = p.getProperty("FP_BASEURL").toString();
url2 = p.getProperty("FP_LOGISTIC_IMGUPLD_PROBLEM").toString();
camera = (Button) findViewById(R.id.btn_camera);
done = (Button) findViewById(R.id.btn_done);
title = (EditText) findViewById(R.id.workorder_title);
notes = (EditText) findViewById(R.id.workorder_notes);
latlongInfo = (TextView) findViewById(R.id.latlngStatus);
showSavedFiles();
camera.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (entity == null) {
entity = new MultipartEntityBuilder();// err
}
if (!checkPermissionForStorage()) {
requestPermissionForStorage();
} else {
if (!checkPermissionForCamera()) {
requestPermissionForCamera();
} else {
if (5 == file_count) {
Toast.makeText(Logistic_ReportProblem.this, "You have already added 5 images", Toast.LENGTH_SHORT).show();
} else {
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
}
}
}
}
});
答
它看起来像MultipartEntityBuilder
没有公共构造函数。请查看文档: https://hc.apache.org/httpcomponents-client-ga/httpmime/apidocs/org/apache/http/entity/mime/MultipartEntityBuilder.html
你应该用静态方法create
创建对象:
MultipartEntityBuilder entity = new MultipartEntityBuilder.create()
请分享你的'MultipartEntityBuilder'代码。你可能把它变成了一个私人类,或者你根本没有指定一个访问说明符 – 0xDEADC0DE
_i知道这个问题之前被问过,但是我搜索了每个where__我没有找到正确的ans_。请只解释我的问题..足够.. – opalfire
是你问我MultiriplentEntityBuilder.class由andriod构建的 – opalfire