三星手机调用照相机:SFEffectCache:clear(), mSize = 0

package com.financialstatistics.activity;


import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Date;


import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.Toast;


/**
 * 收入
 */
public class MenuIncomeActivity extends BaseActivity {


private ImageView image_photo;
private Context context;
private String fileName;
private Activity activity;


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_menu_payout);
context = this;
activity = MenuIncomeActivity.this;
image_photo = (ImageView) findViewById(R.id.image_photo);
image_photo.setOnClickListener(new OnClickListener() {


@Override
public void onClick(View v) {
letCamera();
}
});
}


@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case 1:// 拍照
if (resultCode == RESULT_OK) {
Toast.makeText(this, "拍摄成功", Toast.LENGTH_SHORT).show();
try {
upData(activity, fileName);
} catch (Exception e) {
System.out.println("刷新相册异常:" + e);
}
}
break;
default:
break;
}
}


private void letCamera() {
Intent imageCaptureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
String strImgPath = Environment.getExternalStorageDirectory()
.toString() + "/Income/";// 存放照片的文件夹
fileName = "income_" + new SimpleDateFormat("yyyyMMddHHmmss")// yyyyMMddHHmmss
.format(new Date()) + ".jpg";// 照片命名
File out = new File(strImgPath);
if (!out.exists()) {
out.mkdirs();
}
out = new File(strImgPath, fileName);
strImgPath = strImgPath + fileName;// 该照片的绝对路径
Uri uri = Uri.fromFile(out);
imageCaptureIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
imageCaptureIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
startActivityForResult(imageCaptureIntent, 1);
}


private void upData(Activity activity, String fileName) {
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
Uri uri = Uri.fromFile(new File(fileName));
intent.setData(uri);
activity.sendBroadcast(intent);
}
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
将以下程序补充完整 #include <iostream> #include <fstream> #include <iomanip> using namespace std; template <typename ElemType> class myArrayList { private: int mSize; int mLen; ElemType *mpArr; public: myArrayList(int n); myArrayList(ElemType *a,int n); void show(); ElemType getMax(); //以下函数由同学完成 //void sort(); //myArrayList(myArrayList<ElemtType> &other);//拷贝构造函数 //mymyArrayList<ElemType> & operator =(mymyArrayList<ElemType> &other) }; template <typename ElemType> myArrayList<ElemType>::myArrayList(int n) { this->mSize=n; this->mLen=0; this->mpArr=new ElemType[mSize]; } template <typename ElemType> myArrayList<ElemType>::myArrayList(ElemType *a,int n) { this->mSize=n; this->mLen=n; this->mpArr=new ElemType[mSize]; for(int i=0;i<mLen;i++) mpArr[i]=a[i]; } template <typename ElemType> void myArrayList<ElemType>::show() { for(int i=0;i<mLen;i++) cout<<setw(4)<<mpArr[i]; cout<<endl; } template <typename ElemType> ElemType myArrayList<ElemType>::getMax() { ElemType max; max=mpArr[0]; for(int i=1;i<mLen;i++) if(max<mpArr[i]) max=mpArr[i]; return max; } //Student.h class Student { private: int mId; float height; int score; public: Student(int id=0,float h=0,int s=0):height(h),mId(id),score(s) { } friendbool operator <(Student &a1,Student &a2) { if(a1.height<a2.height) return true; else return false; } friend ostream &operator <<(ostream &out,Student &s) { out<<"ID:"<<s.mId<<" Height:"<<s.height<<" Socre:"<<s.score<<endl; return out; } }; //主程序 int main() { int a[]={1,2,3,5,7,9,12,8}; double b[]={1,2.5,3.6,5,7,9,12.8,8}; myArrayList <int> list1(a,8); list1.show(); cout<<"max="<<list1.getMax()<<endl; myArrayList <double> list2(b,8); list2.show(); cout<<"max="<<list2.getMax()<<endl; Student s[3]={Student(1,175,80),Student(2,178,90),Student(3,195,83)},s1; myArrayList <Student> list3(s,3); list3.show(); cout<<"max="<<list3.getMax()<<endl; } 说明: 将以下程序补充完整 //void sort(); //myArrayList(myArrayList<ElemtType> &other);//拷贝构造函数 //mymyArrayList<ElemType> operator =(mymyArrayList<ElemType> &other) //修改补充 Student类,要求按成绩排序(从高到低)
最新发布
06-01

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值