android開發桌面
A. android開發之設置桌面壁紙
/**
* 裁剪圖片方法實現
* @param uri = Uri.fromFile(new File(path));
*/
public void startPhotoZoom(Uri uri ,Context context) {
Intent intent = new Intent("com.android.camera.action.CROP");
intent.setDataAndType(uri, "image/*");
//下面這個crop=true是設置在開啟的Intent中設置顯示的VIEW可裁剪
intent.putExtra("crop", "true");
// aspectX aspectY 是寬高的比例
intent.putExtra("aspectX", 1);
intent.putExtra("aspectY", 1);
// outputX outputY 是裁剪圖片寬高
intent.putExtra("outputX", 150);
intent.putExtra("outputY", 150);
intent.putExtra("return-data", true);
((Activity)context).startActivityForResult(intent, 3);
}
B. android開發 桌面文件夾是如何實現的公司自己要實現這樣一個文件夾程序放在用戶手機
android switch 控制項
C. Android開發如何創建打開指定Activity的桌面圖標
1.使用Context傳遞。
然後
強制轉換
context為那個Activity類調用打開對話框的函數,如((XXOOActivity)context).打開對話框();
2.自定義Listener。
在View中寫好
回調
的調用,然後在Activity中對該View設置這個自定義的Listener,然後在回調事件中調用打開對話框的函數。
第一種針對性強,如果說這個View重復被多個Activity調用,處理起來很麻煩,推薦使用第二種。
D. Android開發設置鎖屏壁紙
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
File file = new File("mnt/sdcard2/DCIM/Camera/IMG_20120216_160054.jpg");
Intent intent = createSetAsIntent(Uri.fromFile(file),null);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(Intent.createChooser(intent, "設置壁紙"));
// file:///mnt/sdcard2/DCIM/Camera/IMG_20120216_160054.jpg
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
public static Intent createSetAsIntent(Uri uri, String mimeType) {
// Infer MIME type if missing for file URLs.
if (uri.getScheme().equals("file")) {
String path = uri.getPath();
int lastDotIndex = path.lastIndexOf('.');
if (lastDotIndex != -1) {
mimeType = MimeTypeMap.getSingleton()
.getMimeTypeFromExtension(
uri.getPath().substring(lastDotIndex + 1)
.toLowerCase());
}
}
Intent intent = new Intent(Intent.ACTION_ATTACH_DATA);
intent.setDataAndType(uri, mimeType);
intent.putExtra("mimeType", mimeType);
return intent;
}
E. 安卓平台,如果開發一個桌面小工具求示例。
你說的桌面小工具是自己寫的apk還是android手機功能的調用。比如說鬧鍾:AlarmManager這是android中系統原生的方法。如果要做一個完整的鬧鍾apk程序就還要調用sd卡存儲,音樂播放,及界面跳轉等等。
F. Android開發設置動態壁紙後重啟才生效問題
那是你可能用了「安卓優化大師」或「360優化大師」之類的軟體,並開啟了定時清理內存的任務,而你的「動態壁紙程序」正好在清理的范圍內,所以才會出現這種現象。
建議:
1、在優化大師或衛士中的「定時清理內存」相關選項中,將「動態壁紙程序」移出自動清理范圍,或
2、將「定時清理內存」任務關閉,自己手動進行內存清理,就可以了。
祝你好運,歡迎追問!
G. Android Studio 開發app 桌面上顯示有多個圖標
解決辦法
把做為moudle庫文件的AndroidManifest中launcher activity給注銷了 不然開啟會多出主app圖標
java"><applicationandroid:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<!--<activity-->
<!--android:name=".MainActivity"-->
<!--android:label="@string/app_name"-->
<!--android:theme="@style/AppTheme.NoActionBar">-->
<!--<intent-filter>-->
<!--<actionandroid:name="android.intent.action.MAIN"/>-->
<!--<categoryandroid:name="android.intent.category.LAUNCHER"/>-->
<!--</intent-filter>-->
<!--</activity>-->
</application>
H. android 開發桌面小插件的大小問題
appWidget是可以放在一個view裡面的,你只要給這個view設置大小就可以了
I. android 開發! 怎麼修改程序的圖標 !在桌面顯示的圖標!
只換drawable文件夾的圖標是不夠的,因為如果在drawable-xxx文件夾下面存在的話,會優先根據對應的解析度選擇不同的文件夾,所以程序選中的未必是你的drawable文件夾下面,所以為了省事,你可以把其他目錄下面的icon刪除,或者每個目錄下面的圖標都替換下,這樣程序的圖標才可以在任意解析度的機器上顯示正確。
J. android開發怎麼設置主題
ndroid:theme="@android:style/Theme.Dialog" 將一個Activity顯示為能話框模式
•android:theme="@android:style/Theme.NoTitleBar" 不顯示應用程序標題欄
•android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 不顯示應用程序標題欄,並全屏
•android:theme="Theme.Light" 背景為白色
•android:theme="Theme.Light.NoTitleBar" 白色背景並無標題欄
•android:theme="Theme.Light.NoTitleBar.Fullscreen" 白色背景,無標題欄,全屏
•android:theme="Theme.Black" 背景黑色
•android:theme="Theme.Black.NoTitleBar" 黑色背景並無標題欄
•android:theme="Theme.Black.NoTitleBar.Fullscreen" 黑色背景,無標題欄,全屏
•android:theme="Theme.Wallpaper" 用系統桌面為應用程序背景
•android:theme="Theme.Wallpaper.NoTitleBar" 用系統桌面為應用程序背景,且無標題欄
•android:theme="Theme.Wallpaper.NoTitleBar.Fullscreen" 用系統桌面為應用程序背景,無標題欄,全屏
•android:theme="Translucent" 半透明
•android:theme="Theme.Translucent.NoTitleBar" 半透明、無標題欄
•android:theme="Theme.Translucent.NoTitleBar.Fullscreen" 半透