21.通知 通过Notification.Builder(context);来创建通知 通过通知管理者发送通知。
Notification.Builder builder = new Notification.Builder(this);
NotificationManager manager= (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
manager.notify(1,builder.build());
22.Bmob进行数据存储的实体类 继承BmobObject 提供set(),get()。Bmob后台每一条数据就是一个实体类对象
23.上下文菜单 属于每个view 而选项菜单属于activity
使用上下文菜单步骤:
1.给view注册上下文菜单 registerForContextMenu(view());
2.添加上下文菜单项(可以通过xml或者代码添加)重写onCreateContextMenu(),如果是xml文件则通过
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.m,menu);
3.响应上下文菜单事件 onContextItemSelected()
24.添加子菜单 通过menu.addSubMenu()方法
android 基本控件篇二
最新推荐文章于 2025-08-14 10:16:47 发布