Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>"Result set changed" means that the set of packages matching that intent has changed from the set you specified when you created the default - - so the default is no longer valid. Your list of components (which you are currently setting to null) needs to contain all homescreen apps present on device, not just yours.</p> <p>Here's example code that I have tested (using adb shell am start <a href="http://www.google.co.uk/" rel="noreferrer">http://www.google.co.uk/</a> ) and used to set the default browser. XXX represents a customer name that I had to black out. </p> <p>Note that in order to call addPreferredActivity you must have compiled against a minimum-sdk version of 8 (2.2) and you must have specified the SET_PREFERRED_APPLICATIONS permission. That permission is protection level 2, so you need to be signed with the same certificate as PackageManager.</p> <pre><code>IntentFilter filter = new IntentFilter(); filter.addAction("android.intent.action.VIEW"); filter.addCategory("android.intent.category.DEFAULT"); filter.addDataScheme("http"); Context context = getApplicationContext(); ComponentName component = new ComponentName("com.opera.mini.XXX", "com.opera.mini.XXX.CustomerBrowser"); ComponentName[] components = new ComponentName[] {new ComponentName("com.android.browser", "com.android.browser.BrowserActivity"), component}; pm.addPreferredActivity(filter, IntentFilter.MATCH_CATEGORY_SCHEME, components, component); </code></pre> <p>ETA - if you marked this response down, could you let me know why. The code I posted above is tested and working...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload