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" 半透