问题一:Notification
的build()
方法是在API level 16
才有的
代码:
notification = new Notification.Builder(ctx)
.setContentTitle("Title").setContentText("Text")
.setSmallIcon(R.drawable.ic_launcher).build();
提示错误:
Call requires API level 16 (current min is 14): android.app.Notification.Builder#build
原因见文档:
public Notification build ()
Combine all of the options that have been set and return a new Notification object.Added in API level 16
也就是说,Notification
的 build ()
方法是在API level 16
才有的;而我的适配版本是API level 14
,需要使用getNotification ()
才行。
问题二:
adb
服务出现异常,如果想手工关闭adb
服务,可以使用下面的命令:
关闭adb服务命令:adb kill-server
启动adb服务命令:adb start-server
问题三:
eclipse
下按alt+/
快捷键无代码提示故障:
也不知道为啥会出现这个问题,我的情况解决方法如下:
Window
-> Preferences
-> General
-> Keys
1. Restore Defaults
恢复默认设置;
2. 把word completion
的快捷键设置alt+C
;
3. 把Content Assist
的快捷键由ctrl+space
改成alt+/
;
4. window
-> Preferences
-> Java
-> Editor
-> Content Assist
-> Enable auto activation
选项要打上勾;
Android编程遇到的小问题20150819
原文链接:https://beltxman.com/1297.html,若无特殊说明本站内容为 行星带 原创,未经同意禁止转载。
Android编程遇到的小问题还真有点难搞
奇奇怪怪的各种问题~