Application in Android to transfer values to activity

Source: Internet
Author: User

For example, Aurora registration to obtain the user's unique identification ID needs to be passed at login, to implement the specified user push function of the message

 1  public   String ID;  2  3  public< /span> String getId () { 4  return   ID;  5  }  6  7  public  void   SetId (String id) { 8  this . ID = ID;  9 } 
1     // Initialize Aurora push 2         Jpushinterface.setdebugmode (true); 3         Jpushinterface.init (this); 4 5         id = Jpushinterface.getregistrationid (Getapplicationcontext ()); 6 7         LOG.E ("Aurora push get User ID", id);

How to get that in activity, the code is as follows

1         MyApplication application = (MyApplication) getapplication (); 2         String id = Application.getid (). toString (); 3         LOG.E ("Aurora push user-specified ID", id);

Application in Android to transfer values to activity

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.