android技术文档
文章平均质量分 92
萧条歌声
这个作者很懒,什么都没留下…
展开
-
android布局属性
android布局属性android:background布局的背景android:layout_marginTop距上一个布局的间隔距离android:gravity布局中文字的位置,如:居中android:layout_gravity整个布局的位置,如垂直居中等android:layout_alignParentTop布局的位置是否处于顶部,同时还有左、右、底部andr转载 2015-01-20 09:45:21 · 421 阅读 · 0 评论 -
静态方法和属性调用
一个类的静态方法和静态属性可以直接调用,不用新建对象例如:public class DoovMonthByWeekAdapter extends DoovSimpleWeeksAdapter { //获取是否有点击状态 public static boolean isClickState() { Log.d("ghshuai", "DoovMont原创 2015-03-04 14:40:20 · 809 阅读 · 0 评论 -
android中延迟执行某个任务
android中延迟执行某个任务android App开发在某些情况下需要有延时功能,比如说App首页显示定格3秒,然后自动跳到登录页的情况,这就好比是一个预加载,但是这个预加载可能瞬间就完成了,撑不到3秒钟,这是就要求你做延时处理。下面是三种方法:一、线程[html] view plaincopy1. new Thread(转载 2015-03-11 21:41:52 · 312 阅读 · 0 评论 -
获取屏幕的宽度和高度的方法
int www = this.getResources().getDisplayMetrics().widthPixels; int hhh = this.getResources().getDisplayMetrics().heightPixels; Log.d("ghshuai5","AlerActivity ==== onCreate ======= iii="+www+",原创 2015-03-12 10:34:54 · 596 阅读 · 0 评论 -
TextView 内容横向滚动的设置方法
android:layout_width="50dp" android:layout_height="fill_parent" android:layout_gravity="center_vertical" android:ellipsize="marquee" android:gravity="center_vertica原创 2015-03-23 19:05:49 · 448 阅读 · 0 评论 -
baseAdapt getView 重复执行很对遍原因
mViewSwitcher = (ViewSwitcher)v.findViewById(R.id.switcher); mViewSwitcher.setFactory(this); mViewSwitcher.getCurrentView().requestFocus(); @Override public View makeVie原创 2015-05-07 18:05:18 · 465 阅读 · 0 评论 -
Android 向系统日历中添加事件
Android 向系统日历中添加事件 查了一天半,总算有点大概了。以下是自己的理解,有错误的地方望指正。 android系统有日历功能,应用程序可以根据一些接口开发自己的功能,即使是日历app也是根据这些接口开发的,所以我们可以利用程序向系统日历写入事件,然后用手机上的日历软件就可以看到我们添加的事件。网上这方面资料也不少,也有demo,但是我没找到一个可以正确运行的,有的是缺转载 2015-05-26 23:26:39 · 5125 阅读 · 2 评论 -
日历月份日期显示错误,修改
[DESCRIPTION] 农历显示错误 [SOLUTION] 农历每月的天数信息存储在Calendar资源文件的 res/values/lunar_const_arrays.xml 的integer-array lunar_info中;每个item展开为2进制数,表示的意义如下:二进制形式xxxx xxxx xxxx xxxx x原创 2015-07-11 14:39:24 · 1614 阅读 · 0 评论 -
日历节气显示不正常2015年1月6号是小寒,而现在是显示2015年1月5号是小寒
[SOLUTION] 二十四节气现在可以用通用计算公式来做计算,但是都会存在一定的误差。对于现在和过去年份的数据可以通过紫金山天文台官方网站进行数据查询,但是对于未来年份的数据也没有官方的查询方式。我们使用通用公式计算出2035年的立夏是5月5日,立秋为8月7日;但最终还是以天文台最后公布出的数据为准。现在节气在Calendar的实现是将节气数据统计在一起并通过转载 2015-07-11 15:11:06 · 773 阅读 · 0 评论 -
Menu 列表 中方法调用
onCreateOptionsMenu 只会创建一次,这个方法在Activity 加载完后调用 onPrepareOptionsMenu 每次点击menu 键都会调用一次 onOptionsItemSelected 点击menu列表中的item 的方法调用原创 2015-03-02 11:27:31 · 398 阅读 · 0 评论 -
设置屏幕常亮 switch
首先要在AndroidManifest中加权限 import android.os.BatteryStats.Uid.Wakelock;import android.os.PowerManager;import android.os.PowerManager.WakeLock;由于 Class是Fragment ,所以用getActivity()去获取getA原创 2015-01-23 09:33:50 · 9583 阅读 · 0 评论 -
activity 之间信息的传递 Intent 回调参数startActivityForResult
activity 中信息的传递 1,第一个Activity Intent mintent = new Intent(); mintent.setClass(AddClockActivity.this, LabelEdit.class); startActivityForResult(mintent, REQUSET_LABEL_EDIT);原创 2015-01-19 18:16:59 · 1145 阅读 · 0 评论 -
Paint 属性
void setARGB(int a, int r, intg, int b) 设置Paint对象颜色,参数一为alpha透明通道 void setAlpha(int a) 设置alpha不透明度,范围为0~255 void setAntiAlias(boolean aa) //是否抗锯齿 void setColor(转载 2015-01-15 11:28:50 · 465 阅读 · 0 评论 -
Activity 参数传递 Intent
第一个Activity发布消息Intent mIntent=new Intent();mIntent.setClass(getActivity(), Charcaterstopwatch.class);String maskLabel =mask_label.getText().toString();mIntent.putExtra("showlabel", maskLabel);原创 2015-01-23 11:11:16 · 383 阅读 · 0 评论 -
linearlayout水平靠右显示方法
参考资料:http://www.cnblogs.com/olvo/archive/2012/05/21/2511632.htmlhttp://wenku.baidu.com/view/b1a339ebaeaad1f346933f70.html在安卓中,只有垂直的linearlayout属性里面的内部组件靠左靠右才有效,同理,水平的linearlayout属性里面的内部组件靠上靠下才有效,否则无效由转载 2015-01-13 18:02:05 · 12275 阅读 · 0 评论 -
将Android Activity以对话框Dialog形式显示
在注册Activity的时候加上如下属性即可:android:theme="@style/DeskClock.Dialog"例如: <activity android:name="com.android.deskclock.timer.AlertActivity" android:launchMode="singleInstance"原创 2015-01-23 09:29:13 · 448 阅读 · 0 评论 -
Android开发之日历控件实现
Android开发之日历控件实现 本文介绍Android平台上几种有用的的日历控件。日历控件在Web开发中有很多的解决方案,而且很容易实现,但是在Android平台上的解决方案较少且不容易实现。下面给大家开始介绍几种及我们实现的示例。 我们大家都知道,在Android平台3.0中才新增了日历视图控件,可以显示网格状的日历内容,那么对于Android 3转载 2015-01-23 15:05:23 · 758 阅读 · 0 评论 -
隐藏键盘方法
InputMethodManager imm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(LabelEdit.this.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWA原创 2015-01-19 18:20:15 · 449 阅读 · 0 评论 -
闹钟音量调节 进度条 SeekBar
private int maxVolume, currentVolume; public AudioManager audiomanage; public SeekBar volumeSeekBar; -----------------volumeSeekBar=(SeekBar)findViewById(R.id.VolumeSeekBar); audioma原创 2015-01-20 11:49:04 · 746 阅读 · 0 评论 -
android:showAsAction用法
当你的应用程序目标设为蜂巢平台时,你可以利用Action Bar部件提供的全部功能,将你的选项菜单项放在Action Bar的右上角,对用户来说使用更方便,控制该行为的主菜单项属性是android:showAsAction。 这个属性可接受的值有: 1、always:这个值会使菜单项一直显示在Action Bar上。 2、ifRoom:如果有足够的空间,这个值会使菜单项显示在Actio转载 2015-07-16 18:24:41 · 634 阅读 · 0 评论