TraceView报错:unable to open trace file

2018-03-13 22:42:44

程序效率有些问题,想起用TraceView来分析一下,可是一直报标题中的错误,无法创建出我所需要的aa.trace文件,分析也就无从做起。


上网查了一些资料好多都说是没有添加权限造成的,好吧,我承认一开始确实没有添加权限,按网上的说法把这一句加到了Manifest.xml中:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>


可是问题依旧呀,后来继续查找资料,才发现问题出在了Android的安全机制上面,所以将所要生成的文件添加上该应用对应的路径,问题解决了!

在oncrete()中将Debug.startMethodTracing("aa.trace")修改为:

Debug.startMethodTracing("/data/data/com.yourapp/aa.trace"),问题解决。



  • 2017-11-10 00:06:15

    CORS: credentials mode is 'include'

    XMLHttpRequest cannot load http://localhost/Foo.API/token. The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://localhost:5000' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

  • 2017-11-19 00:17:51

    Java如何获取Date的“昨天”与“明天”示例代码

    最近在做项目的时候用到Date和Calendar比较多,而且用到的方式也比较全,突然想到一个问题,Java如何获取Date的"昨天"与"明天",也就是前一天和后一天呢?思考后写出了方法,想着万一以后用到,就总结出来,也方便有需要的朋友们参考借鉴,下面来一起看看吧。

  • 2017-11-23 02:00:51

    js 分页插件twbs-pagination

    ​cdn地址 http://www.bootcdn.cn/twbs-pagination/ 官网地址 可以在cdn地址上面查看到