Kai*_*ski 4 android live-wallpaper
我只想在预览活动中从动态壁纸选择应用程序运行壁纸时绘制文本消息.(使用"设置壁纸"和"设置"按钮).
由于我将有一个免费和付费版本,在免费版本中,我还想让用户了解付费版本功能,甚至在预览壁纸时启用这些功能,但不是在主屏幕上实际运行时避免烦扰他们.
有任何想法吗?
作为替代方案,我可能会在第一次启动壁纸时显示此信息,这将始终来自预览活动.
您是否愿意检查您的壁纸是否已经设置?
在您的实施中,WallpaperService#onCreateEngine()
您可以这样做:
WallpaperManager wpm = (WallpaperManager) getSystemService(WALLPAPER_SERVICE);
WallpaperInfo info = wpm.getWallpaperInfo();
if (info != null && info.getComponent().equals(new ComponentName(this, getClass()))) {
Log.d(TAG, "We're already running");
// Still might be a preview, but the user is already running your LWP.
} else {
Log.d(TAG, "We're not running, this should be a preview");
// Should definitely be a preview.
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2212 次 |
最近记录: |