无法在onReceive()中调用cameraImage()方法。
private BroadcastReceiver dataReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent i) {
Log.e("Data", "Service Recieved");
responseString = i.getStringExtra(DataRequest.EXTENDED_DATA_STATUS);
textView.setText(responseString);
if (Float.parseFloat(responseString) < 100) {
cameraImage();
}
}
};
cameraImage()是用同一个活动编写的
public void cameraImage(){
camera.takePicture(null, null, jpegCallback);
}