// 版本低于Android 6.0,直接顯示懸浮窗
}
}
6.0版本的android可以在按鍵點擊啟動服務時加入判斷,給程序一個手動設置權限,就可以顯示出來
}
}
6.0版本的android可以在按鍵點擊啟動服務時加入判斷,給程序一個手動設置權限,就可以顯示出來
2016-12-30
} else {
// 跳轉到相關的設置權限設置頁面
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
} else {
// 跳轉到相關的設置權限設置頁面
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
} else {
2016-12-30
public void startService(View v) {
//判斷程序sdk版本
if (Build.VERSION.SDK_INT >= 23) {
if (Settings.canDrawOverlays(this)) {
//如果賦權直接如行如下程序
Intent intent = new Intent(this, MyFloatService.class);
startService(intent);
//判斷程序sdk版本
if (Build.VERSION.SDK_INT >= 23) {
if (Settings.canDrawOverlays(this)) {
//如果賦權直接如行如下程序
Intent intent = new Intent(this, MyFloatService.class);
startService(intent);
2016-12-30
開始跟著老師敲了一遍,后面自己又再敲了一次,才發現了很多問題一開始沒有搞清楚,https://github.com/kiritozzl/FloatCircleView360/tree/master這是項目代碼,該注意的地方都做了注釋,希望能給一起學習的同學一點幫助~