简体   繁体   English

设置iPhone和Android的墙纸-Appcelerator

[英]Set Wallpaper of iPhone and Android - Appcelerator

How can I set the wallpaper of iPhone and Android from with in App. 如何在App中通过iPhone和Android设置墙纸。 Is there any API defined by Appcelerator I searched on google but no solution found. 我在Google上搜索的Appcelerator是否定义了任何API,但未找到解决方案。

For iPhone there is no any method or API for it through Titanium Appcelerator. 对于iPhone,没有通过Titanium Appcelerator为其提供任何方法或API的方法。

But for Android there is a code which help you for set direct wallpaper. 但是对于Android,有一个代码可以帮助您设置直接墙纸。

var intent = Ti.Android.createIntent({
    action: Ti.Android.ACTION_ATTACH_DATA,
    type: "image/*"
});
intent.addCategory(Ti.Android.CATEGORY_DEFAULT);
intent.setData('/IMAGE PATH/', "image/jpeg");
intent.putExtra("mimeType", "image/jpeg");
var intentChooser = Ti.Android.createIntentChooser(intent, "Set as:");
Ti.Android.currentActivity.startActivity(intentChooser);

Hope this help you out. 希望这对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM