My mobile Butler (20) Application Management Introduction Popupwindow Click events

Source: Internet
Author: User

My mobile Butler (20) Application Management Introduction Popupwindow Click events

android:drawabletop= show pictures in "@drawable/img2"//textview

<?XML version= "1.0" encoding= "Utf-8"?><LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"android:orientation= "Horizontal" >    <TextViewAndroid:id= "@+id/tv_lanuch"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:drawabletop= "@drawable/img2"Android:text= "Start" />    <TextViewAndroid:id= "@+id/tv_uninstall"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:drawabletop= "@drawable/img1"Android:text= "Unload" />    <TextViewAndroid:id= "@+id/tv_share"Android:layout_width= "Wrap_content"Android:layout_height= "Wrap_content"Android:drawabletop= "@drawable/img3"Android:text= "Share" /></LinearLayout>

Corresponding Click events for the three people:

(1) Application start-up requires the use of Packagemanager according to the specified PackageName

To launch the appropriate application Pm.getlaunchintentforpackage (PackageName);

(2) Uninstall the application , after the uninstallation is complete, rewrite the refresh interface, using the start activity with callback value

To the appropriate uninstall interface,

    Intent Intent = new Intent (intent.action_delete);     Intent.addcategory (Intent.category_default);     Intent.setdata (Uri.parse ("package:" +packagename));

    

/*** Launch App*/     Public voidlaunch (String packagename) {packagemanager pm=Getpackagemanager (); //Get the App Launcher screen IntentIntent Intent =pm.getlaunchintentforpackage (PackageName);    StartActivity (Intent); }    /*** Uninstall App*/     Public voidUninstall (String packagename) {//Jump to uninstall interfaceIntent Intent =NewIntent (Intent.action_delete);        Intent.addcategory (Intent.category_default); Intent.setdata (Uri.parse ("Package:" +PackageName)); Startactivityforresult (Intent,0); }    /*** Share Apps*/     Public voidShare (String packagename) {Intent Intent=NewIntent (intent.action_send); Intent.settype ("Text/plain");//Send TextIntent.putextra (Intent.extra_text, PackageName);    StartActivity (Intent); }     Public voidStartactivityforresult (Intent Intent,intRequestcode) {Initappdata ();//after the uninstallation is complete, rewrite the Refresh interface
Super. Startactivityforresult (Intent, Requestcode); }

My mobile Butler (20) Application Management Introduction Popupwindow Click events

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.