资源简介

Android开发艺术探索 书中源码下载(任玉刚)

资源截图

代码片段和文件信息

package com.ryg.chapter_1;

import com.ryg.chapter_1.R;

import android.R.integer;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.onclickListener;

public class MainActivity extends Activity {

    private static final String TAG = “MainActivity“;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        if (savedInstanceState != null) {
            String test = savedInstanceState.getString(“extra_test“);
            Log.d(TAG “[onCreate]restore extra_test:“ + test);
        }
        findViewById(R.id.button1).setonclickListener(new onclickListener() {

            @Override
            public void onclick(View v) {
                Intent intent = new Intent(“com.ryg.charpter_1.c“);
                //intent.setClass(MainActivity.this SecondActivity.class);
                intent.putExtra(“time“ System.currentTimeMillis());
                intent.addCategory(“com.ryg.category.c“);
                intent.setDataAndType(Uri.parse(“file://abc“) “text/plain“);
                startActivity(intent);
            }
        });
    }
    
    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        Log.d(TAG “onNewIntent time=“ + intent.getLongExtra(“time“ 0));
    }

    @Override
    protected void onstart() {
        Log.d(TAG “onstart“);
        super.onstart();
    }

    @Override
    protected void onResume() {
        Log.d(TAG “onResume“);
        super.onstart();
    }

    @Override
    public void onConfigurationchanged(Configuration newConfig) {
        super.onConfigurationchanged(newConfig);
        Log.d(TAG “onConfigurationchanged newOrientation:“ + newConfig.orientation);
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        Log.d(TAG “onSaveInstanceState“);
        outState.putString(“extra_test“ “test“);
    }
    
    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
        //Log.d(TAG “onRestoreInstanceState“);
        String test = savedInstanceState.getString(“extra_test“);
        Log.d(TAG “[onRestoreInstanceState]restore extra_test:“ + test);
    }

    @Override
    protected void onPause() {
        Log.d(TAG “onPause“);
        super.onPause();
    }
    
    @Override
    protected void onstop() {
        Log.d(TAG “onstop“);
        super.onstop();
    }
    
    @Override
    protected void onDestroy() {
        Log.d(TAG “onDestroy“);
        super.onDestroy();
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-11-12 13:19  android-art-res-master\
     文件         300  2015-11-12 13:19  android-art-res-master\.gitignore
     目录           0  2015-11-12 13:19  android-art-res-master\Chapter_1\
     文件         466  2015-11-12 13:19  android-art-res-master\Chapter_1\.classpath
     文件         812  2015-11-12 13:19  android-art-res-master\Chapter_1\.project
     文件        2033  2015-11-12 13:19  android-art-res-master\Chapter_1\AndroidManifest.xml
     文件       51394  2015-11-12 13:19  android-art-res-master\Chapter_1\ic_launcher-web.png
     目录           0  2015-11-12 13:19  android-art-res-master\Chapter_1\libs\
     文件      995386  2015-11-12 13:19  android-art-res-master\Chapter_1\libs\android-support-v4.jar
     文件         781  2015-11-12 13:19  android-art-res-master\Chapter_1\proguard-project.txt
     文件         563  2015-11-12 13:19  android-art-res-master\Chapter_1\project.properties
     目录           0  2015-11-12 13:19  android-art-res-master\Chapter_1\res\
     目录           0  2015-11-12 13:19  android-art-res-master\Chapter_1\res\drawable-hdpi\
     文件        7658  2015-11-12 13:19  android-art-res-master\Chapter_1\res\drawable-hdpi\ic_launcher.png
     目录           0  2015-11-12 13:19  android-art-res-master\Chapter_1\res\drawable-mdpi\
     文件        3777  2015-11-12 13:19  android-art-res-master\Chapter_1\res\drawable-mdpi\ic_launcher.png
     目录           0  2015-11-12 13:19  android-art-res-master\Chapter_1\res\drawable-xhdpi\
     文件       12516  2015-11-12 13:19  android-art-res-master\Chapter_1\res\drawable-xhdpi\ic_launcher.png
     目录           0  2015-11-12 13:19  android-art-res-master\Chapter_1\res\drawable-xxhdpi\
     文件       24777  2015-11-12 13:19  android-art-res-master\Chapter_1\res\drawable-xxhdpi\ic_launcher.png
     目录           0  2015-11-12 13:19  android-art-res-master\Chapter_1\res\drawable\
     文件         621  2015-11-12 13:19  android-art-res-master\Chapter_1\res\drawable\edit.xml
     目录           0  2015-11-12 13:19  android-art-res-master\Chapter_1\res\layout\
     文件         696  2015-11-12 13:19  android-art-res-master\Chapter_1\res\layout\activity_main.xml
     文件         646  2015-11-12 13:19  android-art-res-master\Chapter_1\res\layout\activity_second.xml
     文件         646  2015-11-12 13:19  android-art-res-master\Chapter_1\res\layout\activity_third.xml
     目录           0  2015-11-12 13:19  android-art-res-master\Chapter_1\res\values\
     文件         114  2015-11-12 13:19  android-art-res-master\Chapter_1\res\values\colors.xml
     文件         166  2015-11-12 13:19  android-art-res-master\Chapter_1\res\values\strings.xml
     文件        1301  2015-11-12 13:19  android-art-res-master\Chapter_1\res\values\styles.xml
     目录           0  2015-11-12 13:19  android-art-res-master\Chapter_1\src\
............此处省略752个文件信息

评论

共有 条评论