小编Riz*_*med的帖子

以编程方式在Android应用中清除缓存

什么是以编程方式清除android应用程序中的缓存的正确方法.我已经使用了以下代码,但它看起来不适合我

@Override
protected void onDestroy() {
    // TODO Auto-generated method stub
    super.onDestroy();
    clearApplicationData();
}

public void clearApplicationData() {
    File cache = getCacheDir();
    File appDir = new File(cache.getParent());
    if (appDir.exists()) {
        String[] children = appDir.list();
        for (String s : children) {
            if (!s.equals("lib")) {
                deleteDir(new File(appDir, s));
                Log.i("EEEEEERRRRRRROOOOOOORRRR", "**************** File /data/data/APP_PACKAGE/" + s + " DELETED *******************");
            }
        }
    }
}

public static boolean deleteDir(File dir) {
    if (dir != null && dir.isDirectory()) {
        String[] children = dir.list();
        for (int i …
Run Code Online (Sandbox Code Playgroud)

android

57
推荐指数
5
解决办法
9万
查看次数

DataSet不支持c#中的System.Nullable <>异常

public partial class Form2 : Form
{
        public Form2()
        {
            InitializeComponent();
        }
        private void Form2_Load(object sender, EventArgs e)
        {
            RST_DBDataContext db = new RST_DBDataContext();
            var d = (from s in db.TblSpareParts
                                        select new {  s.SPartName, s.SPartCode, s.ModelID, s.SPartLocation,  s.SPartActive, s.SPartSalePrice }).ToArray();
            CrystalReport1 c = new CrystalReport1();
            c.SetDataSource(d);
            crystalReportViewer1.ReportSource = c;

        } 
}
Run Code Online (Sandbox Code Playgroud)

我正在尝试在sql表中生成水晶报告SPartSalePrice因为在c.SetDataSource(d)上可以为空; 异常来请解决

c# dataset

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1

c# ×1

dataset ×1