Back to project page Android-Cloud-Storage-Application.
The source code is released under:
MIT License
If you think the Android project Android-Cloud-Storage-Application 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.cloudaltas; /*from w ww.j av a 2s . c om*/ import android.R; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import com.example.cloudaltas.library.UserFunctions; public class DashboardActivity extends Activity { UserFunctions userFunctions; Button btnLogout; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); /** * Dashboard Screen for the application * */ // Check login status in database userFunctions = new UserFunctions(); if(userFunctions.isUserLoggedIn(getApplicationContext())){ setContentView(R.layout.dashboard); btnLogout = (Button) findViewById(R.id.btnLogout); Intent startNewActivityOpen = new Intent(DashboardActivity.this, UploadImage.class); startActivityForResult(startNewActivityOpen, 0); btnLogout.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { // TODO Auto-generated method stub userFunctions.logoutUser(getApplicationContext()); Intent login = new Intent(getApplicationContext(), LoginActivity.class); login.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(login); // Closing dashboard screen finish(); } }); }else{ // user is not logged in show login screen Intent login = new Intent(getApplicationContext(), LoginActivity.class); login.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(login); // Closing dashboard screen finish(); } } }