`
文章列表
三部分 1.MyClock.java(设置界面) 2.CallAlarm.java(BroadcastReceiver) 3.AlarmAlert.java(闹钟响应)   1.MyClock.java(设置界面)   private EditText etHour1, etMinute1, etHour2, etMinute2; private TextView txTime1, txTime2; private Button buSet1, buCancel1, buSet2, buCancel2; private Calendar calendar = Cal ...
两部分ControlService.java(Activity)和MyService.java(Service) MyService.java   import android.app.Service; import android.content.Intent; import android.os.Handler; import android.os.IBinder; import android.util.Log; public class MyService extends Service { /* 建立Handler对象 ...
添加权限   <uses-permission android:name="android.permission.READ_PHONE_STATE" />     private TextView myTextView1; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.phone_state); myTextView1 = ...
    private Button myButton; private TextView myTextView; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.sd_size); myButton = (Button) findViewById(R.id.button1); myTextView = (TextView) findViewById(R.id.textView1 ...
    private EditText title_ed; private EditText content_ed; private Button save; private Button read; private Button delete; private TextView tv_title; private TextView tv_content; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContent ...
  private int intLevel; private int intScale; private Button mButton01; private AlertDialog d; private BroadcastReceiver mBatInfoReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); /* * 如果捕捉到的ac ...
添加权限   <uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>     import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content ...
添加权限   <uses-permission android:name="android.permission.CHANGE_CONFIGURATION"></uses-permission>  在manifest.xml中的activity中设置configuration的属性   <activity android:name=".ConfigChange" android:label="@string/app_name" android:configChange ...
添加权限   <uses-permission android:name="android.permission.READ_PHONE_STATE" />     private TelephonyManager telMgr; private SimpleAdapter listItemAdapter; // ListView的适配器 private ArrayList<HashMap<String, Object>> listItem; // ListView的数据源,这里是一个HashMap的列表 pr ...
添加权限   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />   MyGesture.java   private Gesture ges; private GestureLibrary lib; private GestureOverlayView overlay; private Button button01, button02 , button03; private EditText et; private Str ...
添加权限   <uses-permission android:name="android.permission.GET_TASKS"></uses-permission>       private ListView myList; private ActivityManager mActivityManager; private Button button1; public void onCreate(Bundle savedInstanceState) { super.onCreat ...
添加权限:   <uses-permission android:name="android.permission.SET_WALLPAPER"></uses-permission>     private Button button1; private Button button2; private ImageView imageView1; private ImageView imageView2; private ImageView imageView3; public void onCreate(Bund ...
    File cacheDir; File fileDir; /* 取得目前Cache目录 */ cacheDir = this.getCacheDir(); /* 取得目前File目录 */ fileDir = this.getFilesDir();    
Wifi的五种状态   WifiManager.WIFI_STATE_ENABLED//已打开 WifiManager.WIFI_STATE_DISABLING//正在关闭 WifiManager.WIFI_STATE_ENABLING//正在打开 WifiManager.WIFI_STATE_DISABLED//已关闭 WifiManager.WIFI_STATE_UNKNOWN//未知   一、打开关闭Wifi  添加权限   <uses-permission android:name="android.permission.C ...
添加权限:   <uses-permission android:name="android.permission.READ_PHONE_STATE" /> private TelephonyManager telMgr; private TextView tv_state; private TextView tv_number; private TextView tv_operator_number; private TextView tv_operator; private TextView tv_country; @S ...
Global site tag (gtag.js) - Google Analytics