![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Android
flyfly121
这个作者很懒,什么都没留下…
展开
-
AsyncTask的注意事项
AsyncTask对于生命周期较短且需要在UI上显示进度和结果的后台操作是很好的解决方案但是,但Activity重新启动时,这种操作将不会继续。也就是说,AsyncTask在设备的方向变化而导致Activity被销毁和重新创建时会被取消。对于生命周期较长的后台操作,如从Internet下载数据,使用Service组件是更好的选择。类似的,Cursor Loader则是使用Conte原创 2014-12-16 22:51:19 · 323 阅读 · 0 评论 -
自定义View(来自Android API Demo)
/* * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo原创 2015-02-12 09:11:49 · 613 阅读 · 0 评论 -
thread exiting with uncaught exception
问题:thread exiting with uncaught exception没有详细错误信息。解决方案:Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() {@Overridepublic void uncaughtException(Thread thread, T原创 2015-03-10 09:03:13 · 549 阅读 · 0 评论 -
Android Bluetooth打开关闭
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();if (mBluetoothAdapter == null) { Toast.makeText(this, "不支持蓝牙", Toast.LENGTH_SHORT).show();} else if (!mBluetoothAdapter.isEnabled()) {翻译 2015-12-21 00:10:07 · 645 阅读 · 0 评论 -
【android】IntentService
public class MyIntentService extends IntentService {@overrideprotected void onHandleIntent(Intent intent) {......}}其他应用程序组件想要通过IntentService完成一个任务,需要启动Service并传递给它一个包含完成该任务所需的参数的Intent。I原创 2016-03-10 00:53:06 · 320 阅读 · 0 评论 -
【android】在Activity中重写onNewIntent方法
getIntent()方法总是返回最初用来创建Activity的Intent。在一些情况下,Activity在启动后可能继续接收Intent。可以使用Widget和Notification提供一些快捷方式使之能在一个可能依然在运行的Activity中显示数据,虽然该Activity是不可见的。可以在Activity中重写onNewIntent处理程序来接收和处理在Activit原创 2016-03-10 01:12:14 · 1227 阅读 · 0 评论 -
Android Studio生成release jar
原创 2017-04-05 22:37:39 · 1475 阅读 · 0 评论