摘要:
1) 创建服务 public class MyService extends Service 2) 添加注册表 <service android:name="cn.itang.fuwudemo.MyService"></service> 3) 重写方法 public void onCreate() 阅读全文
摘要:
###手动创建活动 1. 创建布局文件 1) 在layout中创建一个布局类XML 2. 创建一个活动类 1) 在src中创建一个包,再创建一个活动类继承Activity,重写onCreate类 2) 加载布局文件 方法:setContentView(布局位置); 3. 注册活动 AndroidMa 阅读全文
摘要:
1) 在res中创建一个menu的文件夹 2) 在文件夹中创建一个main.xml的类 3) 添加代码 <item android:id=”添加id” android:title=”显示内容”></item> 1) 在活动中重写onCreateOptionsMenu方法 public boolean 阅读全文
摘要:
让活动切换有两种方式 显示意图和隐式意图 显示意图:只能在本应用中穿梭; 隐式意图:可以调用其他应用程序的活动,包括系统应用,但是需要配置清单文件 显式Intent 1) 创建一个新的活动 2) 确定进入新活动的条件 也可以使用方法 getClass(上下文,class); 隐式Intent 配置清 阅读全文
摘要:
###通知’ NotificationManager manager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE); Notification notification = new Notification 阅读全文
摘要:
用ListView实现对数据库的内容显示 MyBase base = new MyBase(); SQLiteDatabase db = mySQLhelpes.getReadableDatabase(); Cursor cursor = db.query("inof", null, null, n 阅读全文