How to get the list of all installed shortcuts found in the homescreen Launcher in android

后端 未结 1 784
无人共我
无人共我 2021-02-07 17:32

I wanted to get the list of all installed shortcuts in the homescreen launcher programmatically. I have found lots of snippets online but none of them provides the right output<

相关标签:
1条回答
  • 2021-02-07 18:05

    My answer may be late, but it might be useful for others.

    Check my code:

    if (Build.VERSION.SDK_INT <8) 
    { 
    url = "content://com.android.launcher.settings/favorites?Notify=true"; 
    } 
    else 
    { 
    url = "content://com.android.launcher2.settings/favorites?Notify=true"; 
    } 
    
    ContentResolver resolver = getContentResolver(); 
    Cursor cursor = resolver.query (Uri.parse(url), null, null, null, null);
    
    0 讨论(0)
提交回复
热议问题