android基础
常态
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
android如何拨打电话
方法一:直接拨打电话,需要添加权限<uses-permission android:name="android.permission.CALL_PHONE" />/** * 直接拨打电话 * @param phoneNumber 电话号码 */public void callPhone(String phoneNumber){ Intent intent = new Intent(Intent.ACTION_CALL); Uri data = Uri.pars原创 2020-05-28 17:22:36 · 1309 阅读 · 0 评论 -
listview简单使用与优化
对于很多初学者来说,listview一直是一个难点,刚才整理了一段代码,介绍了listview的使用方式与简单优化,以及item的更新xml version="1.0" encoding="utf-8"?>xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas原创 2017-02-27 15:54:47 · 254 阅读 · 0 评论 -
安卓TimePicker控件简单使用
xml version="1.0" encoding="utf-8"?>xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:l原创 2017-02-27 15:23:24 · 879 阅读 · 0 评论 -
DataPicker简单应用
xml version="1.0" encoding="utf-8"?>xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:l原创 2017-02-27 14:58:14 · 752 阅读 · 0 评论 -
ProgressBar、Handler的简单使用
xml version="1.0" encoding="utf-8"?>xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:l原创 2017-02-27 13:26:03 · 647 阅读 · 0 评论 -
Gridview简单使用
XML布局文件xml version="1.0" encoding="utf-8"?>xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"原创 2017-02-27 10:56:37 · 275 阅读 · 0 评论 -
安卓如何使用Intent传递对象
最近有些人问我怎么用Intent传递对象,首先说明,Intent传递对象,是需要序列化的,下面介绍一下两个activity之间如何传递对象首先,创建一个工具类,实现Serializable接口,如下:public class UserBean implements Serializable{ String name,sex; public UserBean(Stri原创 2017-03-02 10:29:15 · 366 阅读 · 0 评论 -
安卓Activity的四大启动模式
一直想写一篇activity的四种启动模式的文章,闲来整理了一下;一个task可以管理多个Activity,启动一个应用,也就创建一个与之对应的task。Activity一共有以下四种launchMode:1.standard(standard是系统默认的启动模式)2.singleTop3.singleTask4.singleInstance我们可以在android原创 2017-03-01 17:08:47 · 325 阅读 · 0 评论 -
如何使用PopupWindow
PopupWindon与Dialog功能相似,PopupWindon是阻塞式对话框,Dialog是非阻塞式对话框。可按需要自由选择与上篇介绍的Dialog一样,这里就不多说了,上代码public class MainActivity extends AppCompatActivity { private PopupWindow popupWindow; private原创 2017-03-01 13:29:44 · 280 阅读 · 0 评论 -
如何自定义Dialog
在日常编辑中,很多地方要用到自定义Dialog,下面简单介绍下其用法,直接上代码了Dialog布局这里就不上代码了,你可以随意设置主布局设置一个按钮,点击的时候弹出Dialog,如下:public class MainActivity extends AppCompatActivity { private Button btn; private EditText原创 2017-03-01 13:23:53 · 295 阅读 · 0 评论 -
ListView取消默认点击背景颜色
说是取消点击背景颜色,其实是把背景颜色设置为透明,如下<ListView android:layout_width="match_parent" android:layout_height="match_parent" android:listSelector="@android:color/transparent" >这样点击item的时候原创 2017-03-01 10:22:06 · 3823 阅读 · 0 评论 -
ListView去掉中间的分割线
去掉分割线的话,直接设置属性divider即可,如下;<ListView android:layout_width="match_parent" android:layout_height="match_parent" android:divider="@null">原创 2017-03-01 10:17:27 · 663 阅读 · 0 评论 -
SeekBar调节手机屏幕亮度
xml version="1.0" encoding="utf-8"?>xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:l原创 2017-02-28 13:08:36 · 1075 阅读 · 0 评论 -
DatepickerDialog与TimepickerDialog使用
由于两个控件相似,实现功能也比较简单,就把他们写在一起了,直接上代码 xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:ori原创 2017-02-27 18:57:31 · 447 阅读 · 0 评论
分享