Android Open Source - savemypics C Start Activity






From Project

Back to project page savemypics.

License

The source code is released under:

Copyright (c) 2014, KB Sriram All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. R...

If you think the Android project savemypics 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 org.savemypics.android.activity;
/*  w  w  w  .ja  va 2 s .  c o  m*/
import android.accounts.Account;
import android.accounts.AccountManager;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.os.Bundle;
import android.provider.MediaStore;
import android.widget.ListView;
import java.util.ArrayList;
import java.util.List;
import org.savemypics.android.R;
import org.savemypics.android.util.CUtils;

public class CStartActivity extends AActivity
{
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        m_account_adapter =
            new CAccountInfoListAdapter(this, getAccounts());
        ((ListView) findViewById(R.id.main_list))
            .setAdapter(m_account_adapter);
        // Save app version-string somewhere easy to obtain.
        try {
            PackageInfo pi =
                getPackageManager().getPackageInfo(getPackageName(), 0);
            m_version = String.valueOf(pi.versionCode)+"/"+pi.versionName;
        }
        catch (Throwable ign) {
            CUtils.LOGD(TAG, "Skip version data", ign);
            m_version = "unknown";
        }
    }

    @Override
    protected void onResume()
    {
        super.onResume();
        m_account_adapter.onResume(getAccounts());
    }

    @Override
    protected void onPause()
    {
        m_account_adapter.onPause();
        super.onPause();
    }

    @Override
    protected void onActivityResult(int req, int res, Intent data)
    {
        CUtils.LOGD(TAG, "on-activity-result: "+res+":"+data);
    }

    void startAddAccount(Intent intent)
    { startActivityForResult(intent, REQ_ADD_ACCOUNT); }

    String getVersion()
    { return m_version; }

    private final List<Account> getAccounts()
    {
        AccountManager mgr = AccountManager.get(this);
        List<Account> ret = new ArrayList<Account>();

        Account[] accounts = mgr.getAccountsByType(CUtils.BASE_ACCOUNT_TYPE);
        for (Account acct: accounts) {
            ret.add(acct);
        }
        return ret;
    }

    private CAccountInfoListAdapter m_account_adapter;
    private String m_version = null;
    private final static int REQ_ADD_ACCOUNT = 1;
    private final static String TAG = CUtils.makeLogTag(CStartActivity.class);
}




Java Source Code List

android.util.Base64.java
org.savemypics.android.activity.AActivity.java
org.savemypics.android.activity.ABaseSettingsActivity.java
org.savemypics.android.activity.CAccountInfoListAdapter.java
org.savemypics.android.activity.CFlickrSettingsActivity.java
org.savemypics.android.activity.CSnapfishSettingsActivity.java
org.savemypics.android.activity.CStartActivity.java
org.savemypics.android.authenticator.AAuthenticatorActivity.java
org.savemypics.android.authenticator.CAuthenticationService.java
org.savemypics.android.authenticator.CAuthenticator.java
org.savemypics.android.authenticator.CFlickrLoginHookActivity.java
org.savemypics.android.authenticator.CFlickrWebActivity.java
org.savemypics.android.authenticator.CSelectProviderActivity.java
org.savemypics.android.authenticator.CSnapfishLoginActivity.java
org.savemypics.android.db.CAccount.java
org.savemypics.android.db.CDb.java
org.savemypics.android.db.CLocalImage.java
org.savemypics.android.db.CMap.java
org.savemypics.android.db.CRemoteImage.java
org.savemypics.android.event.AEvent.java
org.savemypics.android.event.CEventBus.java
org.savemypics.android.event.CExceptionEvent.java
org.savemypics.android.glue.ABaseGlue.java
org.savemypics.android.glue.CFlickrGlue.java
org.savemypics.android.glue.CSnapfishGlue.java
org.savemypics.android.receiver.CNetworkChangeReceiver.java
org.savemypics.android.service.CTaskQueue.java
org.savemypics.android.sync.CMediaUtils.java
org.savemypics.android.sync.CSyncAdapter.java
org.savemypics.android.sync.CSyncService.java
org.savemypics.android.sync.CSyncUtils.java
org.savemypics.android.util.CBitmapUtils.java
org.savemypics.android.util.CFileCache.java
org.savemypics.android.util.CLruCache.java
org.savemypics.android.util.CUtils.java
org.savemypics.android.util.CUtils.java
org.savemypics.android.view.CMaximumWidthLayout.java
org.savemypics.android.view.CModularLayout.java
org.savemypics.android.view.CRefreshButton.java
org.savemypics.android.view.CRoundedBitmapView.java
org.savemypics.android.view.CStatusCounterView.java
org.savemypics.plugin.CIOUtils.java
org.savemypics.plugin.CPlugin.java
org.savemypics.plugin.flickr.CFlickrAlbum.java
org.savemypics.plugin.flickr.CFlickrUtils.java
org.savemypics.plugin.snapfish.CSnapfishAlbum.java
org.savemypics.plugin.snapfish.CSnapfishFeed.java
org.savemypics.plugin.snapfish.CSnapfishUser.java
org.savemypics.plugin.snapfish.CSnapfishUtils.java