Android Open Source - Android-Cloud-Storage-Application Dashboard Activity






From Project

Back to project page Android-Cloud-Storage-Application.

License

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.

Java Source Code

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();
        }
        
        
        
        
    }

  
  

}




Java Source Code List

com.example.cloudaltas.Base64.java
com.example.cloudaltas.DashboardActivity.java
com.example.cloudaltas.FullscreenActivity.java
com.example.cloudaltas.LoginActivity.java
com.example.cloudaltas.RegisterActivity.java
com.example.cloudaltas.UploadImage.java
com.example.cloudaltas.library.DatabaseHandler.java
com.example.cloudaltas.library.JSONParser.java
com.example.cloudaltas.library.UserFunctions.java
com.example.cloudaltas.util.SystemUiHiderBase.java
com.example.cloudaltas.util.SystemUiHiderHoneycomb.java
com.example.cloudaltas.util.SystemUiHider.java
com.example.cloudaltas.first.java
com.example.cloudaltas.hello.java