Back to project page userapp-android.
The source code is released under:
MIT License
If you think the Android project userapp-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.demo; /* w ww . j a v a 2 s. co m*/ import io.userapp.client.android.UserApp; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.Menu; import android.view.MenuItem; public class MainActivity extends FragmentActivity { // Instances for session and its UI helper UserApp.Session session; UserApp.UIHelper uiHelper; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Initiate the session and create a new UI helper bound to it session = new UserApp.Session(this); uiHelper = session.createUIHelper(R.id.loginFragment, R.id.mainFragment, R.id.signupFragment); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle presses on the action bar items switch (item.getItemId()) { // Logout action case R.id.action_logout: session.logout(); return true; default: return super.onOptionsItemSelected(item); } } @Override public void onResume() { super.onResume(); uiHelper.onResume(); } @Override public void onPause() { super.onPause(); uiHelper.onPause(); } }