Jess
Jess

Reputation: 85

How to hide Android home screen widget

Is there any way to hide(or handle under a flag) the HomeScreen Widget from preview screen so that user can't add it?

Tried to remove the WidgetProvider broadcast component declaration from Manifest file and its seems to be working fine.The Widget is is not displayed in preview screen. Is this the right way? Any alternative?

Upvotes: 0

Views: 307

Answers (1)

seekingStillness
seekingStillness

Reputation: 5103

Yes, you can prevent your home screen widget from being displayed in the widget picker preview screen by setting the previewImage attribute to 0 in your app widget provider metadata. This will hide the preview image for your widget and prevent it from being displayed in the widget picker.

<appwidget-provider 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:previewImage="0"
    ...>
    ...
</appwidget-provider>

Upvotes: 0

Related Questions