Currently everything happens inside MainActivity; which means no matter what everyone has to go through the first "preferences" window to get to the monitor window. However, I'd like to open the monitor window itself by launching an activity without having to click on the "show monitor" button everytime. Using a separate activity for the monitor window would help me achieve just that.
但是后来想想,CPUBW和Memory bus frequency虽然有对应的数值关联,但两个概念还是应该分开显示,不要像我这样直接转换比较好。CPUBW是带宽值,虽然不清楚高通怎么定义的,估计是Mb/s?
如果用文本自定义直接转换,就看不到CPUBW值了,而且文本自定义会把GPUBW也一起转了……
所以希望可以设立成两个单独项目(新增 Memory bus frequency 项目)。
01-21 18:33:05.663 4217-4217/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: xzr.perfmon, PID: 4217
java.lang.RuntimeException: Unable to create service xzr.perfmon.FloatingWindow: java.lang.NullPointerException: Attempt to invoke interface method 'float android.content.SharedPreferences.getFloat(java.lang.String, float)' on a null object reference
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2791)
at android.app.ActivityThread.access$1800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1402)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5280)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:963)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:758)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'float android.content.SharedPreferences.getFloat(java.lang.String, float)' on a null object reference
at xzr.perfmon.FloatingWindow.init(FloatingWindow.java:66)
at xzr.perfmon.FloatingWindow.onCreate(FloatingWindow.java:290)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2781)