摘要:
25,//Notification,控制顶部状态栏的通知,不会自动消失,需要手动清除,//在notificationxml.xml文件中添加7个按钮View Code 1 public class SubNotificationActivity extends Activity { 2 private static int NOTIFICATIONS_ID = R.layout.activity_notification; 3 private NotificationManager mNotificationManager; 4 @Override 5 pro... 阅读全文
摘要:
24,//Toast的使用<1>//Toast,界面上显示一个提示,长时间和短时间显示 ,在toast.xml文件中2个button 1 public class SubToastActivity extends Activity{ 2 private Button shortButton = null; 3 private Button longButton = null; 4 private static int NOTIFICATION_ID = R.layout.activity_toast; 5 @Override 6 protected vo... 阅读全文
摘要:
23,//Service的应用<1>//manifest.xml对service注册<service android:name=".FirstService"></service><2>//Java文件 1 public class TestActivity extends Activity { 2 private Button startServiceButton = null; 3 private Button stopServiceButton = null; 4 @Override 5 public void onCr 阅读全文
摘要:
22,//Dialog用法,7个小例子<1>//main.xmlView Code 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:layout_width="fill_parent" 4 android:layout_height="fill_parent" 5 阅读全文