@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.pick_friends_activity); lifecycleHelper = new UiLifecycleHelper(this, new Session.StatusCallback() { @Override public void call(Session session, SessionState state, Exception exception) { onSessionStateChanged(session, state, exception); } }); lifecycleHelper.onCreate(savedInstanceState); this.savedInstanceState = savedInstanceState; loadFriendPicketFragment(); ensureOpenSession(); }
public void onCreate(Bundle paramBundle) { super.onCreate(paramBundle); setContentView(2130903060); ς.ˊ(this); if (paramBundle != null) this.mShouldConnectPlusClient = paramBundle.getBoolean("plus_client_connection_state"); this.uiHelper = new UiLifecycleHelper(this, this.callback); this.uiHelper.onCreate(paramBundle); Plus.PlusOptions localPlusOptions = new Plus.PlusOptions.Builder().addActivityTypes(new String[] { "http://schemas.google.com/AddActivity", "http://schemas.google.com/BuyActivity" }).build(); this.mGoogleApiClient = new GoogleApiClient.Builder(this).addConnectionCallbacks(this).addOnConnectionFailedListener(this).addApi(Plus.API, localPlusOptions).addScope(Plus.SCOPE_PLUS_LOGIN).build(); this.animationHelper = new LoginActivityAnimationHelper(); this.animationHelper.onCreate(this, paramBundle); if (paramBundle == null) hideLoadingLayer(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Ciclo de vida de la sesion de autenticacion de Facebook uiHelper = new UiLifecycleHelper(this, callback); uiHelper.onCreate(savedInstanceState); setContentView(R.layout.activity_logout); FragmentManager fm = getSupportFragmentManager(); logout = fm.findFragmentById(R.id.logOutFragment); // Ocultamos todos los fragments que maneja nuestra activity para despues mostrarlo si procede o saltar a la siguiente activity. FragmentTransaction transaction = fm.beginTransaction(); transaction.show(logout); transaction.commit(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); uiHelper = new UiLifecycleHelper(this, null); uiHelper.onCreate(savedInstanceState); params = getIntent().getBundleExtra(DIALOG_PARAMS); dialogType = (FBDialogUtils.DialogType) getIntent().getSerializableExtra(DIALOG_TYPE); switch (dialogType) { case SHARE_DIALOG: final FacebookDialog.ShareDialogBuilder builder = FBDialogUtils.createShareDialogBuilder(this, params); uiHelper.trackPendingDialogCall(builder.build().present()); break; default: Log.e(FB.TAG, "Unrecognized Dialog Type"); } }
@Override public void onCreate(Bundle savedInstanceState) { DatabaseHandler DB = new DatabaseHandler(getActivity()); if(DB.getTeacherCount()!=0){ Intent intent = new Intent(getActivity(), MainActivity.class); String UUID = DB.getTeacherName(); String Name = DB.getTeacherUUID(); intent.putExtra("UUID",UUID); intent.putExtra("Name", Name); startActivity(intent); } super.onCreate(savedInstanceState); uiHelper = new UiLifecycleHelper(getActivity(), callback); uiHelper.onCreate(savedInstanceState); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { uiHelper = new UiLifecycleHelper(mActivity, null); uiHelper.onCreate(savedInstanceState); getActivity().setTitle(getFragmentTitle()); id = mActivity.getSharedPreferences("fbInfo", Context.MODE_PRIVATE).getString("id", ""); if (isNetworkAvailable(mActivity)) { new Thread(new Runnable() { public void run() { itemNames = SimpleDB.getFollowingFeedItemNames(id); adapter = new MySimpleArrayAdapter(mActivity, itemNames); adAdapter = new AdListAdapter(mActivity, adapter); mActivity.runOnUiThread(new Runnable() { @Override public void run() { setListAdapter(adAdapter); } }); } }).start(); } return inflater.inflate(R.layout.main_listfragment, container, false); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { uiHelper = new UiLifecycleHelper(mActivity, null); uiHelper.onCreate(savedInstanceState); getActivity().setTitle(getFragmentTitle()); if (isNetworkAvailable(mActivity)) { new Thread(new Runnable() { public void run() { itemNames = SimpleDB.getFeedItemNamesByCategory("movie"); adapter = new MySimpleArrayAdapter(mActivity, itemNames); adAdapter = new AdListAdapter(mActivity, adapter); mActivity.runOnUiThread(new Runnable() { @Override public void run() { setListAdapter(adAdapter); } }); } }).start(); } return inflater.inflate(R.layout.main_listfragment, container, false); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { uiHelper = new UiLifecycleHelper(mActivity, null); uiHelper.onCreate(savedInstanceState); getActivity().setTitle(getFragmentTitle()); id = mActivity.getSharedPreferences("fbInfo", Context.MODE_PRIVATE).getString("id", ""); if (isNetworkAvailable(mActivity)) { new Thread(new Runnable() { public void run() { itemNames = SimpleDB.getMyQuotesItemNames(id); adapter = new MySimpleArrayAdapter(mActivity, itemNames); adAdapter = new AdListAdapter(mActivity, adapter); mActivity.runOnUiThread(new Runnable() { @Override public void run() { setListAdapter(adAdapter); } }); } }).start(); } return inflater.inflate(R.layout.main_listfragment, container, false); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { uiHelper = new UiLifecycleHelper(mActivity, null); uiHelper.onCreate(savedInstanceState); getActivity().setTitle(getFragmentTitle()); if (isNetworkAvailable(mActivity)) { new Thread(new Runnable() { public void run() { itemNames = SimpleDB.getPopularFeedItemNames(); adapter = new MySimpleArrayAdapter(mActivity, itemNames); adAdapter = new AdListAdapter(mActivity, adapter); mActivity.runOnUiThread(new Runnable() { @Override public void run() { setListAdapter(adAdapter); } }); } }).start(); } return inflater.inflate(R.layout.main_listfragment, container, false); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { uiHelper = new UiLifecycleHelper(mActivity, null); uiHelper.onCreate(savedInstanceState); getActivity().setTitle(getFragmentTitle()); if (isNetworkAvailable(mActivity)) { new Thread(new Runnable() { public void run() { itemNames = SimpleDB.getFeedItemNamesByCategory("funny"); adapter = new MySimpleArrayAdapter(mActivity, itemNames); adAdapter = new AdListAdapter(mActivity, adapter); mActivity.runOnUiThread(new Runnable() { @Override public void run() { setListAdapter(adAdapter); } }); } }).start(); } return inflater.inflate(R.layout.main_listfragment, container, false); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { uiHelper = new UiLifecycleHelper(mActivity, null); uiHelper.onCreate(savedInstanceState); getActivity().setTitle(getFragmentTitle()); if (isNetworkAvailable(mActivity)) { new Thread(new Runnable() { public void run() { itemNames = SimpleDB.getFeedItemNamesByCategory("inspirational"); adapter = new MySimpleArrayAdapter(mActivity, itemNames); adAdapter = new AdListAdapter(mActivity, adapter); mActivity.runOnUiThread(new Runnable() { @Override public void run() { setListAdapter(adAdapter); } }); } }).start(); } return inflater.inflate(R.layout.main_listfragment, container, false); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { uiHelper = new UiLifecycleHelper(mActivity, null); uiHelper.onCreate(savedInstanceState); getActivity().setTitle(getFragmentTitle()); id = mActivity.getSharedPreferences("fbInfo", Context.MODE_PRIVATE).getString("id", ""); if (isNetworkAvailable(mActivity)) { new Thread(new Runnable() { public void run() { itemNames = SimpleDB.getFavoriteFeedItemNames(id); adapter = new MySimpleArrayAdapter(mActivity, itemNames); adAdapter = new AdListAdapter(mActivity, adapter); mActivity.runOnUiThread(new Runnable() { @Override public void run() { setListAdapter(adAdapter); } }); } }).start(); } return inflater.inflate(R.layout.main_listfragment, container, false); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { uiHelper = new UiLifecycleHelper(mActivity, null); uiHelper.onCreate(savedInstanceState); getActivity().setTitle(getFragmentTitle()); if (isNetworkAvailable(mActivity)) { new Thread(new Runnable() { public void run() { itemNames = SimpleDB.getFeedItemNamesByCategory("advice"); adapter = new MySimpleArrayAdapter(mActivity, itemNames); adAdapter = new AdListAdapter(mActivity, adapter); mActivity.runOnUiThread(new Runnable() { @Override public void run() { setListAdapter(adAdapter); } }); } }).start(); } return inflater.inflate(R.layout.main_listfragment, container, false); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { uiHelper = new UiLifecycleHelper(mActivity, null); uiHelper.onCreate(savedInstanceState); getActivity().setTitle(getFragmentTitle()); if (isNetworkAvailable(mActivity)) { new Thread(new Runnable() { public void run() { itemNames = SimpleDB.getFeedItemNamesByCategory("love"); adapter = new MySimpleArrayAdapter(mActivity, itemNames); adAdapter = new AdListAdapter(mActivity, adapter); mActivity.runOnUiThread(new Runnable() { @Override public void run() { setListAdapter(adAdapter); } }); } }).start(); } return inflater.inflate(R.layout.main_listfragment, container, false); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { uiHelper = new UiLifecycleHelper(mActivity, null); uiHelper.onCreate(savedInstanceState); userId = getArguments().getString("userId"); userName = getArguments().getString("username"); getActivity().setTitle(getFragmentTitle()); if (isNetworkAvailable(mActivity)) { new Thread(new Runnable() { public void run() { itemNames = SimpleDB.getUserItemNames(userId); adapter = new MySimpleArrayAdapter(mActivity, itemNames); adAdapter = new AdListAdapter(mActivity, adapter); mActivity.runOnUiThread(new Runnable() { @Override public void run() { setListAdapter(adAdapter); } }); } }).start(); } return inflater.inflate(R.layout.main_listfragment, container, false); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { uiHelper = new UiLifecycleHelper(mActivity, null); uiHelper.onCreate(savedInstanceState); getActivity().setTitle(getFragmentTitle()); if (isNetworkAvailable(mActivity)) { new Thread(new Runnable() { public void run() { itemNames = SimpleDB.getFeedItemNamesByCategory("song"); adapter = new MySimpleArrayAdapter(mActivity, itemNames); adAdapter = new AdListAdapter(mActivity, adapter); mActivity.runOnUiThread(new Runnable() { @Override public void run() { setListAdapter(adAdapter); } }); } }).start(); } return inflater.inflate(R.layout.main_listfragment, container, false); }
public static void shareToFB(Activity activity, String quoteText, UiLifecycleHelper uiHelper) { if (FacebookDialog.canPresentOpenGraphActionDialog(activity.getApplicationContext(), FacebookDialog.OpenGraphActionDialogFeature.OG_ACTION_DIALOG)) { OpenGraphObject quote = OpenGraphObject.Factory.createForPost (OpenGraphObject.class, "speakeasydevfest:post", "I loved this quote!", "http://i.imgur.com/ec9p33P.jpg", null, "\"" + quoteText + "\""); OpenGraphAction action = GraphObject.Factory.create(OpenGraphAction.class); action.setProperty("quote", quote); action.setType("speakeasydevfest:love"); FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(activity, action, "quote") .build(); uiHelper.trackPendingDialogCall(shareDialog.present()); } else { Toast.makeText(activity, "Facebook not available", Toast.LENGTH_SHORT).show(); } }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); uiHelper = new UiLifecycleHelper(this, callback); uiHelper.onCreate(savedInstanceState); setContentView(R.layout.main); FragmentManager fm = getSupportFragmentManager(); fragments[SPLASH] = fm.findFragmentById(R.id.splashFragment); fragments[SELECTION] = fm.findFragmentById(R.id.selectionFragment); fragments[SETTINGS] = fm.findFragmentById(R.id.userSettingsFragment); FragmentTransaction transaction = fm.beginTransaction(); for(int i = 0; i < fragments.length; i++) { transaction.hide(fragments[i]); } transaction.commit(); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); resultsTextView = (TextView) findViewById(R.id.resultsTextView); pickFriendsButton = (Button) findViewById(R.id.pickFriendsButton); pickFriendsButton.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { onClickPickFriends(); } }); lifecycleHelper = new UiLifecycleHelper(this, new Session.StatusCallback() { @Override public void call(Session session, SessionState state, Exception exception) { onSessionStateChanged(session, state, exception); } }); lifecycleHelper.onCreate(savedInstanceState); ensureOpenSession(); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); uiHelper = new UiLifecycleHelper(this, callback); uiHelper.onCreate(savedInstanceState); setContentView(R.layout.main); Logger.getLogger(HttpTransport.class.getName()).setLevel(LOGGING_LEVEL); FragmentManager fm = getSupportFragmentManager(); fragments[SPLASH] = fm.findFragmentById(R.id.splashFragment); fragments[SELECTION] = fm.findFragmentById(R.id.selectionFragment); fragments[SETTINGS] = fm.findFragmentById(R.id.userSettingsFragment); FragmentTransaction transaction = fm.beginTransaction(); for(int i = 0; i < fragments.length; i++) { transaction.hide(fragments[i]); } transaction.commit(); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = getIntent(); score = intent.getLongExtra("score", -1); setContentView(R.layout.main); uiHelper = new UiLifecycleHelper(this, callback); uiHelper.onCreate(savedInstanceState); FragmentManager fm = getSupportFragmentManager(); fragments[SPLASH] = fm.findFragmentById(R.id.splashFragment); fragments[SELECTION] = fm.findFragmentById(R.id.selectionFragment); fragments[SETTINGS] = fm.findFragmentById(R.id.userSettingsFragment); FragmentTransaction transaction = fm.beginTransaction(); for (int i = 0; i < fragments.length; i++) { transaction.hide(fragments[i]); } transaction.commit(); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); if (savedInstanceState != null) { userSkippedLogin = savedInstanceState.getBoolean(USER_SKIPPED_LOGIN_KEY); } uiHelper = new UiLifecycleHelper(this, callback); uiHelper.onCreate(savedInstanceState); FragmentManager fm = getSupportFragmentManager(); SplashFragment splashFragment = (SplashFragment) fm.findFragmentById(R.id.splashFragment); fragments[SPLASH] = splashFragment; fragments[SELECTION] = fm.findFragmentById(R.id.selectionFragment); fragments[SETTINGS] = fm.findFragmentById(R.id.userSettingsFragment); FragmentTransaction transaction = fm.beginTransaction(); for(int i = 0; i < fragments.length; i++) { transaction.hide(fragments[i]); } transaction.commit(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); chatSDKUiHelper = ChatSDKUiHelper.getInstance().get(this); if (integratedWithFacebook && getNetworkAdapter().facebookEnabled()) { uiHelper = new UiLifecycleHelper(this, callback); uiHelper.onCreate(savedInstanceState); } if (getIntent() != null && getIntent().getExtras() != null) { if (DEBUG) Timber.d("From login"); fromLoginActivity = getIntent().getExtras().getBoolean(FROM_LOGIN, false); // So we wont encounter this flag again. getIntent().removeExtra(FROM_LOGIN); } else fromLoginActivity = false; if (savedInstanceState != null) fromLoginActivity = savedInstanceState.getBoolean(FROM_LOGIN, false); if (enableCardToast) { SuperCardToast.onRestoreState(savedInstanceState, ChatSDKBaseActivity.this); } // Setting the default task description. setTaskDescription(getTaskDescriptionBitmap(), getTaskDescriptionLabel(), getTaskDescriptionColor()); }
private void setUpFacebook(final Bundle savedInstanceState) { uiLifecycleHelper = new UiLifecycleHelper(this, statusCallback); uiLifecycleHelper.onCreate(savedInstanceState); LoginButton fbButton = (LoginButton) findViewById(R.id.fb_login_button); fbButton.setReadPermissions(Arrays.asList("email", "user_friends")); }
public FbLoginDelegate(UserHelper userHelper, Activity activity, Bundle savedInstanceState, String... permissions) { this.mContext = activity; this.mPermissions = Arrays.asList(permissions); this.mUserHelper = userHelper; mUiHelper = new UiLifecycleHelper(activity, this); mUiHelper.onCreate(savedInstanceState); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); uiHelper = new UiLifecycleHelper(this, null); uiHelper.onCreate(savedInstanceState); mFortuneText = (TextView) findViewById(R.id.fortune_text); mProgressBar = (ProgressBar) findViewById(R.id.progress_bar); findViewById(R.id.btn_whatsapp).setOnClickListener(this); findViewById(R.id.btn_facebook).setOnClickListener(this); findViewById(R.id.btn_facebook_messenger).setOnClickListener(this); findViewById(R.id.btn_google_plus).setOnClickListener(this); findViewById(R.id.btn_hangouts).setOnClickListener(this); findViewById(R.id.btn_linkedin).setOnClickListener(this); findViewById(R.id.btn_twitter).setOnClickListener(this); findViewById(R.id.btn_viber).setOnClickListener(this); findViewById(R.id.btn_wechat).setOnClickListener(this); Intent extras = getIntent(); if (savedInstanceState != null && savedInstanceState.containsKey(FortuneBean.TABLE_NAME)) { mFortune = (Fortune) savedInstanceState.getSerializable(FortuneBean.TABLE_NAME); updateFortuneTextView(); } else if (extras != null && extras.hasExtra((FortuneBean.TABLE_NAME))) { mFortune = (Fortune) extras.getSerializableExtra(FortuneBean.TABLE_NAME); updateFortuneTextView(); } else { loadFortune(); } findViewById(R.id.horizontal_scroll_view).setVisibility(BuildConfig.HAS_SOCIAL_SHARING ? View.VISIBLE : View.GONE); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_logout); ctx = this; config = new Config(ctx); Toolbar toolbar = (Toolbar) findViewById(R.id.app_bar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); TextView deleteAcount = (TextView) findViewById(R.id.deleteAcount); deleteAcount.setText(Html.fromHtml( deleteAcount.getText().toString() )); deleteAcount.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Logout.this, EraseAcount.class); startActivity(intent); } }); BuildProfile(); /*** * Creando Login de facebook */ uiHelper = new UiLifecycleHelper(this, callback); uiHelper.onCreate(savedInstanceState); LoginButton loginBtn = (LoginButton) findViewById(R.id.authButton); loginBtn.setPublishPermissions(Arrays.asList("email", "public_profile", "publish_actions")); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Controller.getInstance().setDimensionAvatar(this); //Remove title bar this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.splashscreen); DatabaseHelper.init(this); TextView tv = (TextView) findViewById(R.id.splash_text); Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/Raleway_Thin.otf"); tv.setTypeface(tf); if(!isNetworkAvailable()){ CustomYesNoDialog dialog = new CustomYesNoDialog(this){ @Override public void onPositiveClick() { super.onPositiveClick(); finish(); } }; dialog.show(); dialog.transformAsOkDialog(); dialog.setDialogText(R.string.no_network); } Server.addUserAuthenticatedListener(this); LoginButton authButton = (LoginButton)findViewById(R.id.authButton); authButton.setReadPermissions(PERMISSIONS); uiHelper = new UiLifecycleHelper(this, callback); uiHelper.onCreate(savedInstanceState); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_test_facebook); uiHelper = new UiLifecycleHelper(this, callback); uiHelper.onCreate(savedInstanceState); LoginButton loginButton = (LoginButton) findViewById(R.id.authButton); loginButton.setPublishPermissions(Arrays.asList(PERMISSION)); }
@Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View v = inflater.inflate(R.layout.login_frag, container, false); ButterKnife.inject(this, v); mLogin.setFragment(this); mUiHelper = new UiLifecycleHelper(getActivity(), mStatusCallback); mUiHelper.onCreate(savedInstanceState); return v; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); uiHelper = new UiLifecycleHelper(this, this); uiHelper.onCreate(savedInstanceState); // onClickLogout(); updateView(); }
public IUiLifecycleHelperImpl(Activity activity, Session.StatusCallback statusCallback) { if (com.facebook.Settings.getApplicationId() != null) { // make this initialization only if there is an applicationId already configured uiLifecycleHelper = new UiLifecycleHelper(activity, statusCallback); } }
private void initializeFBSession() { lifecycleHelper = new UiLifecycleHelper(this, new Session.StatusCallback() { @Override public void call(Session session, SessionState state, Exception exception) { onSessionStateChanged(session, state, exception); } }); lifecycleHelper.onCreate(savedInstanceState); ensureOpenSession(); }
public void onCreate(Bundle paramBundle) { super.onCreate(paramBundle); this.uiHelper = new UiLifecycleHelper(this, this.callback); this.uiHelper.onCreate(paramBundle); this.mNotificationHelper = new ActivityNotificationHelper(this); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); listaAmigos = new ArrayList<Amigo>(); uiHelper = new UiLifecycleHelper(this, callback); uiHelper.onCreate(savedInstanceState); LoginButton fbLogin = (LoginButton) findViewById(R.id.fbLogin); fbLogin.setPublishPermissions(Arrays.asList("email", "public_profile", "user_friends")); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); LoginButton loginButton = (LoginButton) findViewById(R.id.loginButton); loginButton.setReadPermissions(Arrays.asList("user_friends")); uiHelper = new UiLifecycleHelper(this, callback); uiHelper.onCreate(savedInstanceState); }
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.act_sosmain); mLogs = new Logs(this); mLogs.info("\n\n\n==========================\n=============================="); mLogs.info("SosActivity. onCreate()"); String appId = Prefs.getFbAppId(this); if (appId == null) { appId = getString(R.string.app_id); } Session session = new Session.Builder(getBaseContext()).setApplicationId(appId).build(); Session.setActiveSession(session); mUiHelper = new UiLifecycleHelper(this, null); mUiHelper.onCreate(savedInstanceState); mEventManager = EventManager.getInstance(this); if (Prefs.getSelectedServer(this) == null && Utils.isServerAuthenticated(this)) { Utils.logout(this); } mLogs.info("SosActivity. onCreate. Initiating NetworkManager"); NetworkManager.init(this); mLogs.info("SosActivity. onCreate. Starting PowerButtonService"); startService(new Intent(this, PowerButtonService.class)); if (!Utils.isServiceRunning(this, XmppService.class) && Utils.isServerAuthenticated(this) && !mEventManager.isEventActive()) { startService(new Intent(this, XmppService.class)); } Prefs.setProgramRunning(true, this); mIntentFilter = new IntentFilter(ACTION_SET_LOADING); mIntentFilter.addAction(ACTION_UNSET_LOADING); }