@Override public void onCreate(Bundle savedInstanceState) throws NullPointerException { super.onCreate(savedInstanceState); setContentView(R.layout.activity_debug); Spinner spinner = (Spinner) findViewById(R.id.debug_spinner); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource( this, R.array.planets_array, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); try { frontController = FrontController.getInstance(getApplicationContext()); } catch (AuthorizationException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } try { sm = frontController.getSpaceManager(); } catch (AuthorizationException e) { // If not authorized, force the user to login. frontController.startLoginActivity(); } if (sm != null) { if (sm.getCurrentSpace() != null) { Toast toast = Toast.makeText( getApplicationContext(), sm.getCurrentSpace().getName(), Toast.LENGTH_LONG); toast.show(); } else { Toast toast2 = Toast.makeText(getApplicationContext(), "Its empty!", Toast.LENGTH_LONG); toast2.show(); } } else if (sm == null) { Toast toast3 = Toast.makeText(getApplicationContext(), "Space manager is empty", Toast.LENGTH_LONG); toast3.show(); } }
public void setloginfalse(View v) { frontController.clearCredentials(); // Toast.makeText(this, "User have been logged out", Toast.LENGTH_LONG) // .show(); }