上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页
摘要: 接下来介绍怎么使用Notification。首先需要一个NotificationCompat.Builder ,并使用 A small icon, set by setSmallIcon(),A title, set by setContentTitle(),Detail text, set by setContentText()。除此之外,一般还会为这个通知设置一个Action,即打开一个Activity,通过一个包含了intent的PendingIntent来启动。Intent resultIntent = new Intent(this, ResultActivity.class);.. 阅读全文
posted @ 2013-11-18 22:44 yutoulck 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 寻找并结束进程:使用 ps -ef 寻找进程PID,然后使用 kill -s 9 PID 结束进程。ps:是显示某个瞬间的进程信息。1、-e:显示所有进程和环境变量;2、-f全格式,可以看到PID等等。kill:结束进程。1、-s:表示传递的信号,9是强制结束。Ping命令:-c:ping的次数。 阅读全文
posted @ 2013-11-10 21:36 yutoulck 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 阅读 http://developer.android.com/training/best-ux.html关于怎么使用swipe views。首先要有个布局:这里有两种类可以继承实现pagerview。FragmentPagerAdapterThis is best when navigating between sibling screens representing a fixed, small number of pages.FragmentStatePagerAdapterThis is best for paging across a collection of objects fo 阅读全文
posted @ 2013-11-09 22:22 yutoulck 阅读(312) 评论(0) 推荐(0) 编辑
摘要: 阅读:http://developer.android.com/training/scheduling/index.html让屏幕常亮:public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); getWindow().addFlags(WindowManager.La... 阅读全文
posted @ 2013-11-09 11:16 yutoulck 阅读(345) 评论(0) 推荐(0) 编辑
摘要: 阅读:http://developer.android.com/training/load-data-background/index.html我真的发现官方提供了好多异步操作的东西,例如这个教程里面的CursorLoader。它的特点就是,数据改变的时候,能够自动更新吧,不过你也要自己继承接口并且重写初始化、读取结束、读取刷新等方法,没什么好讲的,官方的例子很清晰可以自己去看。 阅读全文
posted @ 2013-11-09 11:00 yutoulck 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 阅读:http://developer.android.com/training/run-background-service/index.htmlThe IntentService class provides a straightforward structure for running an operation on a single background thread. This allows it to handle long-running operations without affecting your user interface's responsiveness. 阅读全文
posted @ 2013-11-09 10:45 yutoulck 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 阅读:http://developer.android.com/training/basics/network-ops/index.html首先,声明权限检测网络情况:public void myClickHandler(View view) { ... ConnectivityManager connMgr = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(... 阅读全文
posted @ 2013-11-07 22:27 yutoulck 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 官方文档 http://developer.android.com/reference/android/os/Handler.html 有进行解释其实我本身很好奇asynctask是怎么实现的。A Handler allows you to send and process Message and Runnable objects associated with a thread's MessageQueue. Each Handler instance is associated with a single thread and that thread's message q 阅读全文
posted @ 2013-11-07 21:55 yutoulck 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 第六章关于ADT,就是数据还有数据操作的集合,善用ADT,应该把对数据的操作使用ADT而并非直接在代码里对数据进行修改,ADT的好处在于,提高可阅读性,保护了内部数据.创建类抽象接口的建议:1、类的接口应该在同一个层次,即单一责任;2、要理解好类被抽象的真正含义;3、考虑是否需要提供成对的服务;4、如果发现类里面的一半程序在使用自己类的数据,而另一半却在使用其他类的数据,那么应该拆开;5、不要让注释成为接口编程的一部分,注释在编译的时候会被忽略,关于要先做什么再做什么,直接在程序里面体现;6、修改类的时候不要破坏类本身的抽象含义。写函数时不要对使用者有任何的架设。包含关系,注意数目不要操作7- 阅读全文
posted @ 2013-11-06 11:27 yutoulck 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 阅读:https://developer.android.com/training/animation/index.html接下来学学怎么自定义动画。首先学的是渐变,效果打开https://developer.android.com/training/animation/crossfade.html 就能看到了。在这里假设有两个页面交错渐变替换。首先,先获得两个view的引用,然后将要通过渐变显示的view隐藏,然后通过res文件的value来获得动画显示时间:public class CrossfadeActivity extends Activity { private View m... 阅读全文
posted @ 2013-11-05 21:26 yutoulck 阅读(184) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页