Comments

本篇是对《安卓开发中activity的生命周期(1)》做一些补充,主要介绍 Activitytask 的关系。

一、A Task is a stack of activitise

简单的可以理解为当一个Activity运行后会压入栈中,每次展示给用户的都是在栈顶的 Activity,之前运行的 Activity 都被压在了底下,假设有3个 Activity:

One.java
1
2
3
4
5
6
7
8
9
10
11
public class One extends Activity {
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      ......
      Intent i = new Intent();
      i.setClass(One.this, Two.class);
      startActivity(i);
  }
}
阅读全文 →
Comments

看下文章的发布时间,就知道本屌又折腾了好几个小时才把这高亮弄出来,为了让大家少走弯路,都没去陪女朋友睡觉,明天一顿搓衣板是少不了了,大家觉得本文要是有用,就点击下方的赞助,我这顿搓衣板也算没白跪。

闲话不多说,大家在写博文的时候,作为程序员肯定少不了贴代码,而装完octopress后,默认没有语法高亮的功能,让文章看上去着实不爽啊,下面就给大家介绍如何让代码高亮。

以下是Octopress官方的原文:

Sharing code is important, and blogging about it should be easy and beautiful. That’s why Octopress is packed with features to make blogging your code a breeze. Though Jekyll comes with support for Pygments syntax highlighting, Octopress makes it way better. Here’s how.

  • A Sass port of Solarized syntax highlighting created specifically for Octopress.
  • Gist code embedding – by Brandon Tilly.
  • Insert code snippets from your filesystem with a download link.
  • Easy inline code blocks with <figureand <figcaptionand optional download links.
  • Pygments caching – a Jekyll community plugin.
阅读全文 →
Comments

以下是我结合一些资料与个人遇到的一些问题后的总结,让大家在搭建的过程中尽可能的少被坑。

一、创建github账号

首先大家需要在github上面创建一个账户,然后账号需要与创建的blog保持一致,如:创建 zhangzy2345.github.io 则对于的github账号为zhangzy2345,然后 Create Repository,填写的Repository Name为你的blog地址,如:zhangzy2345.github.io

二、安装Git

首先下载 Git for windows ,默认安装后就能使用git了。 接下来通过Git创建一个SSH KEY与之间的创建的github绑定。

在Git中输入:

$ ssh-keygen -t rse -C username@email.com

Note:上面的email换成你注册github账户时填写的email,全部按默认就行了,不用设置密码了,不然以后提交的时候你会很烦,我之前就设置了,之后果断重新弄了一次

执行完成之后会在你的目录(C:/User/username)下面的.ssh目录下面有个 id_sra.pub文件,用记事本去打开它,然后在你的github上面 Account Settings –> SSH Public Keys –> Add 将复制的信息粘贴进去,此时在github上面的设置全部完成。

阅读全文 →