Created
November 19, 2013 23:24
-
-
Save aoberoi/7554435 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //... imports and pacakge declarations | |
| public class SomeActivity extends Activity implements Session.Listener { | |
| Session mSession; | |
| ViewGroup mPublisherViewContainer; | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.some_activity); | |
| mPublisherViewContainer = (ViewGroup) findViewById(R.id.publisherview); | |
| sessionConnect(); | |
| } | |
| private void sessionConnect() { | |
| mSession = Session.newInstance(this, "SESSION_ID", this); | |
| mSession.connect("API_KEY", "TOKEN"); | |
| } | |
| public void onSessionConnected() { | |
| mPublisher = Publisher.newInstance(this, this, "publisher"); | |
| mPublisherViewContainer.addView(mPublisher.getView()); | |
| mSession.publish(mPublisher); | |
| } | |
| // ... other required activity lifecycle methods | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment