Browser Wake-up app

Source: Internet
Author: User

     </activity>        <activity android:name= "com.siyunetwork.wxpluginforunity.AwakenActivity" >            < intent-filter>                <action android:name= "Android.intent.action.VIEW"/>                <category android:name= " Android.intent.category.DEFAULT "/>                <category android:name=" Android.intent.category.BROWSABLE "/>                <data                    android:host= "Com.siyunetwork.zhixiang.majiang"                    android:scheme= "App"/ >            </intent-filter>        </activity>

The Android project needs to write an activity to wake up

 Public classAwakenactivityextendsActivity {String datastring; @Overrideprotected voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Intent Intent=getintent (); Intent Intent1=NewIntent (); Intent1.setclass (awakenactivity. This, Mainactivity.class);//set up a jump activity        if(intent!=NULL) {String action=intent.getaction (); Datastring=intent.getdatastring (); LOG.D ("HHH", datastring); Intent1.putextra ("Datastring", datastring); } awakenactivity. This. StartActivity (INTENT1);    Finish (); }}

Class, override the OnCreate method, set the wake

    String datastring;    @Override    protectedvoid  onCreate (bundle bundle) {        super. OnCreate (bundle);        Intent Intent=getintent ();        Datastring= Intent.getstringextra ("datastring");    }    @Override    protectedvoid  onnewintent (Intent Intent) {        super  . Onnewintent (intent);        Datastring= Intent.getstringextra ("datastring");        Sendtounity ();    }

and send data to unity in mainactivity.

Wake through HTML

(The above content is for your own reference only)

Browser Wake-up app

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.