Advertisement
Guest User

Widget

a guest
Jun 30th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.10 KB | None | 0 0
  1. JAVA CODE:
  2. ==========
  3. PackageManager pm = getPackageManager();
  4. ComponentName compName = new ComponentName(getApplicationContext(), Widget.class);
  5. pm.setComponentEnabledSetting(compName, PackageManager.COMPONENT_ENABLED_STATE_ENABLED,PackageManager.DONT_KILL_APP);
  6.  
  7. ------------------------------------------------------------------------------------------------------------------------
  8.  
  9. ANDROID MAIFESTT:
  10. =================
  11. <receiver
  12.             android:name=".Widget"
  13.             android:installLocation="internalOnly"
  14.             android:enabled="false"
  15.             android:label="Premium" >
  16.             <intent-filter>
  17.                 <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
  18.             </intent-filter>
  19.  
  20.             <meta-data
  21.                 android:name="android.appwidget.provider"
  22.                 android:resource="@xml/premium_widget" />
  23.         </receiver>
  24.  
  25.         <activity android:name=".Configuration" >
  26.             <intent-filter>
  27.                 <action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
  28.             </intent-filter>
  29. </activity>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement