Delphi displays numbers on the phone's desktop icon

Source: Internet
Author: User

function Getlauncherclassname:jstring;var str:jstring;  Localpackagemanager:jpackagemanager;  Intent:jintent;  Localiterator:jiterator;  Localresolveinfo:jresolveinfo;begin Localpackagemanager: = Sharedactivity.getpackagemanager;  Intent: = TJIntent.JavaClass.init (stringtojstring (' Android.intent.action.MAIN '));  Intent.addcategory (stringtojstring (' Android.intent.category.LAUNCHER '));    Try Localiterator: = Localpackagemanager.queryintentactivities (intent,0). iterator; While Localiterator.hasnext does begin localresolveinfo: = Tjresolveinfo.wrap ((localiterator.next as Ilocalobject). G      Etobjectid); if (not LocalResolveInfo.activityInfo.applicationInfo.packageName.equalsIgnoreCase (sharedactivity.getpackagename      ) then Continue;      Result: = LocalResolveInfo.activityInfo.name;    break;  End  Except End;end;procedure Sethuaweibadge (Num:integer); var str:jstring;  Localbundle:jbundle;begin str: = Getlauncherclassname; If Jstringtostring (str) <> "THEN begin localbundle: = TJBundle.JavaClass.init;    Localbundle.putstring (stringtojstring (' package '), Sharedactivitycontext.getpackagename ());    Localbundle.putstring (stringtojstring (' class '), str);    Localbundle.putint (stringtojstring (' Badgenumber '), 3); SharedActivityContext.getContentResolver.call (Strtojuri (' content://com.huawei.android.launcher.settings/badge/  '), stringtojstring (' Change_badge '), stringtojstring (' null '), localbundle); End;end;
Now there is only Huawei's mobile phone, the other non-tested code is not posted out, to find their own Java code conversion.

Judging phone type: TJBuild.JavaClass.MANUFACTURER.EqualsIgnoreCase (stringtojstring (' Huawei '))

  

Delphi displays numbers on the phone's desktop icon

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.