---
title: "android 常用代码汇总"
author: "xiaxingwork"
date: "2013-08-14T17:15:08Z"
tags: []
categories: ["编程语言"]
slug: "android"
draft: false
lastmod: "2013-08-14T17:15:08Z"
id: 1924567
url: "https://xiaxingwork.iteye.com/blog/1924567"
---

```
    Runnable mRunnable = new Runnable() {
        public void run() {
            //TODO function
        }
    };
```

 

```
     class MyRunnable implements Runnable {
        private String name;

        public MyRunnable(String name) {
            this.name = name;
        }

        public void run() {
            //TODO:
        }
    };
```

 

```
        MyRunnable myRunnable = new MyRunnable("name");
        new Thread(myRunnable).start();
```