阻止在电视设备上安装android应用程序
我想阻止用户在智能电视上安装应用程序。我在我的主要活动中实现了这段代码,但似乎并没有阻止它阻止在电视设备上安装android应用程序,android,Android,我想阻止用户在智能电视上安装应用程序。我在我的主要活动中实现了这段代码,但似乎并没有阻止它 if (checkIsTelevision()) { new AlertDialog.Builder(this) .setTitle("Not supported") .setMessage("This app is not compatible with TV devices")
if (checkIsTelevision()) {
new AlertDialog.Builder(this)
.setTitle("Not supported")
.setMessage("This app is not compatible with TV devices")
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
MainActivity.this.finish();
}
})
.setCancelable(false)
.show();
return;
}
有两种解决方案
设备。提及[