我试图在动态壁纸中创建一个警告对话框,基本上要求人们评分..他们可以跳过这里是我有...但它没有显示出来..它在我的webview中工作应用程序,我使用livewallpapercreator.com制作壁纸,我知道你可以在评级对话框中添加壁纸,因为我已经看到它完成。AlertDialog在动态壁纸
public class SBLiveWallpaper extends WallpaperService {
AlertDialog alert;
public int n=0;
int state;
public static final String SHARED_PREFS_NAME="LiveWallpaperPrefs";
@Override
public void onCreate() {
super.onCreate();
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Please Rate Our App 5 Stars! :)")
.setCancelable(false)
.setPositiveButton("RATE NOW", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=")));
}
})
.setNegativeButton("Skip", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
});
alert = builder.create();
alert.show();
}
是不是'WallpaperService' _Service_? –
问题是什么? –
不知道,问题是如何让对话框在浏览壁纸时弹出对话框?现在它不会出现, – user1953299