Android Open Source - tasktracker-android About Activity






From Project

Back to project page tasktracker-android.

License

The source code is released under:

Copyright (c) 2012 Remo Mueller https://github.com/remomueller This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this lice...

If you think the Android project tasktracker-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.

Java Source Code

package com.github.remomueller.tasktracker.android;
//from  www  .  java 2 s .c om
import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.view.MenuItem;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import android.widget.TextView;
import com.github.remomueller.tasktracker.android.util.DatabaseHandler;

import android.content.pm.PackageManager.NameNotFoundException;

import java.util.ArrayList;

public class AboutActivity extends SherlockActivity {
    private static final String TAG = "TaskTrackerAndroid";

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle item selection
        Intent intent;
        switch (item.getItemId()) {
            case android.R.id.home:
            case R.id.stickies:
                intent = new Intent(getApplicationContext(), StickiesIndex.class);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(intent);
                finish();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.about);

        ActionBar actionBar = getSupportActionBar();
        actionBar.setDisplayHomeAsUpEnabled(true);

        DatabaseHandler db = new DatabaseHandler(getApplicationContext());

        try {
            String versionName = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;
            TextView app_version_tv = (TextView) findViewById(R.id.app_version);
            app_version_tv.setText(versionName);
        } catch (NameNotFoundException e) {
            Log.e("tag", e.getMessage());
        }

        TextView database_version_tv = (TextView) findViewById(R.id.database_version);
        database_version_tv.setText(db.getVersion());

        TextView database_tables_tv = (TextView) findViewById(R.id.database_tables);

        String tablesString = "";
        ArrayList<Object> tables = db.getTables();
        if(tables != null && tables.size() > 0){
            for(int i = 0; i < tables.size(); i++){
                tablesString = tablesString + tables.get(i) + "\n";
            }
        }

        database_tables_tv.setText(tablesString);

        User current_user = new User(getApplicationContext());

        TextView user_name_tv = (TextView) findViewById(R.id.user_name);
        user_name_tv.setText(current_user.name());

        TextView user_email_tv = (TextView) findViewById(R.id.user_email);
        if(current_user.email != null) user_email_tv.setText(current_user.email);

        TextView user_id_tv = (TextView) findViewById(R.id.user_id);
        user_id_tv.setText(Integer.toString(current_user.id));

        TextView user_site_url_tv = (TextView) findViewById(R.id.user_site_url);
        if(current_user.site_url != null) user_site_url_tv.setText(current_user.site_url);

    }

}




Java Source Code List

com.github.remomueller.tasktracker.android.AboutActivity.java
com.github.remomueller.tasktracker.android.DashboardActivity.java
com.github.remomueller.tasktracker.android.LoginActivity.java
com.github.remomueller.tasktracker.android.MainActivity.java
com.github.remomueller.tasktracker.android.ProjectAdapter.java
com.github.remomueller.tasktracker.android.Project.java
com.github.remomueller.tasktracker.android.ProjectsIndex.java
com.github.remomueller.tasktracker.android.ProjectsNew.java
com.github.remomueller.tasktracker.android.StickiesFragment.java
com.github.remomueller.tasktracker.android.StickiesIndex.java
com.github.remomueller.tasktracker.android.StickiesNew.java
com.github.remomueller.tasktracker.android.StickiesShow.java
com.github.remomueller.tasktracker.android.StickyAdapter.java
com.github.remomueller.tasktracker.android.Sticky.java
com.github.remomueller.tasktracker.android.Tag.java
com.github.remomueller.tasktracker.android.TaskTracker.java
com.github.remomueller.tasktracker.android.User.java
com.github.remomueller.tasktracker.android.util.AsyncRequest.java
com.github.remomueller.tasktracker.android.util.Base64.java
com.github.remomueller.tasktracker.android.util.DatabaseHandler.java
com.github.remomueller.tasktracker.android.util.ProjectsRequest.java
com.github.remomueller.tasktracker.android.util.StickiesRequest.java
com.github.remomueller.tasktracker.android.util.WebRequest.java