- android开发之MediaPlayer+Service MP3播放器
自律给你自由
android开发serviceandroidbutton音乐stringnull
importjava.io.File;importjava.io.FilenameFilter;importjava.util.ArrayList;importjava.util.List;importandroid.app.ListActivity;importandroid.apps.service.PlayerService;importandroid.content.Intent;impo
- Activity子类详解
olaH
前言往者不可谏,来者犹可追。建立自己的Activity需要继承Activity基类。当然,在不同的场景下,你也可以继承Activity的子类来简化开发。例如,如果应用程序界面只包括列表,则可以让应用程序继承ListActivity;如果应用程序界面需要实现标签页效果,则可以让应用程序继承TabActivity。下面我来介绍一下几个Activity的子类结合的例子。LauncherActivityL
- Android程序记事本源码,安卓记事本程序源代码(Android Notepad program source code).doc...
丨木二丨
Android程序记事本源码
安卓记事本程序源代码(AndroidNotepadprogramsourcecode).doc安卓记事本程序源代码(AndroidNotepadprogramsourcecode)1、MainActivity01.packagecn.dccssq;02。03.importandroid.app.listactivity;04.importent;05.importandroid.database.
- Android第三课--ListView
weixin_33738555
移动开发数据库java
首届Google暑期大学生博客分享大赛——2010Andriod篇由于手机屏幕的限制导致了我们做Android开发要经常用到ListView控件,先给大家看一下什么是ListView:先上一段小程序:1packageccmtc.summercamp.mobile;23importandroid.app.ListActivity;4importandroid.os.Bundle;5importand
- Android笔记 Activity详解
小妮子老男孩
Android笔记-基础Android笔记
1.什么是Activity?Activity作为Android四大组件之一,它有着举足轻重的地位。一般的情况下一个用户交互界面对应一个Activity,它为用户提供一个可视的界面,方便用户操作,比如说拔打电话、照相、发邮件或者是浏览地图等。开发常用的Activity有FragmentActivitiy、ListActivity、PreferenceActivity、TabAcitivty...如果
- 随记
HenryM
1、R.layout从自定义资源中获取R.layout.activity_mainandroid.R.layout从系统模板中获取android.R.layout.simple_list_item_12、拼接字符串,字符串占位符是s%==例:=String.format("姓名:%s","呵呵");3、继承自ListActivity的activity如果要重新写listView,必须有以下id申明
- 从0搭建一个实用的MVVM框架
蜗牛是不是牛
结合Jetpack,构建快速开发的MVVM框架。项目使用Jetpack:LiveData、ViewModel、Lifecycle、Navigation组件。支持动态加载多状态布局:加载中、成功、失败、标题;支持快速生成ListActivity、ListFragment;支持使用插件快速生成适用于本框架的Activity、Fragment、ListActivity、ListFragment。完整文章
- Android LruCache in ListView
zhangphil
Androidandroid
packagezhangphil.cache;importandroid.app.ListActivity;importandroid.graphics.Bitmap;importandroid.graphics.BitmapFactory;importandroid.support.annotation.NonNull;importandroid.support.annotation.Nulla
- Intent传递数据(项目中经常用到的几种类型)
夜行者_姚
1、传递ArrayList数据ArrayListIntentlist_intent=newIntent();list_intent.putStringArrayListExtra(“key值”,m_list);list_intent.setClass(MainActivity.this,ListActivity.class);startActivity(list_intent);接收arrayLi
- 线程池:利用线程池优化查询速度
谷咕咕
javajava开发语言后端线程池
对于同一个页面的两个无关业务,我们可以通过线程池来优化。这里写了两个测试类,比较顺序执行和利用线程池的查询速度差距@Testpublicvoidtest211(){LongbeginTime=newDate().getTime();System.out.println(beginTime+"--------当前时间");Listactivity=activityService.listall(""
- ListView的基本创建方式
简单点了
安卓软件开发androidjava开发语言
ListView的基本创建方式1.ListView主要介绍了采用标签创建以及ArrayAdapter适配器以及采用继承ListActivity的方式创建列表项1.简介是一个列表控件,以列表的形式展示具体内容,可以给各行设置事件监听器ListView中View负责显示和更新,数据由Adapter提供2.属性entires,数据源divider,分割条dividerHeight,分割条高度补充:事件监
- 从0搭建一个实用的MVVM框架
忞鹿
结合Jetpack,构建快速开发的MVVM框架。项目使用Jetpack:LiveData、ViewModel、Lifecycle、Navigation组件。支持动态加载多状态布局:加载中、成功、失败、标题;支持快速生成ListActivity、ListFragment;支持使用插件快速生成适用于本框架的Activity、Fragment、ListActivity、ListFragment。前言随着
- Android实现ListView分页加载数据
本文实例为大家分享了ListView分页加载数据的具体代码,供大家参考,具体内容如下FenyeActivitypackagecom.example.myapplication.fenye;importandroidx.appcompat.app.AppCompatActivity;importandroid.app.ListActivity;importandroid.os.Bundle;impo
- 错误 Your content must have a ListView whose id attribute is 'android.R.id.list'
抓兔子的猫
对于以上错误,其实可能是因为我们要实现对ListView中setOnItemClick的事件监听而去继承了ListActivity,但是却没有ListView的标签.只要在布局文件中添加定制Layout的代码,即将ListView的id设置为“@android:id/list”或android:id="@id/android:list",这时可以用getListView来获取ListView的对象
- emptyView不显示
非爱狂风
使用listView或者gridView时,当列表为空时,有时需要显示一个特殊的emptyview来提示用户,一般情况下,如果你是继承ListActivity,只要当列表为空时就会自动显示TextView但是,如果继承Activity的话,想出现上面的效果,就需要手动ListViewlist=(ListView)findViewById(R.id.mylist);TextViewtv=(TextV
- 大厂一步到位:Android 基础+Android高级+Android高频面试题集锦+Android 知识点分类面试题合集
jett老师
Android基础1、什么是Activity?2、请描述一下Activity生命周期3、常见的Activity类型有FragmentActivitiy,ListActivity,TabAcitivty等。请描述一下Activity生命周期4、如何保存Activity的状态或者(Activiy重启怎么保存数据?)5、两个Activity之间跳转时必然会执行的是哪几个方法?6、Service是否在ma
- 安卓开发学习——day4
观山奇
安卓学习
之前做这个页面使用使用的是LinearLayout,今天经过老师的讲解,改用ListView新建模板istActivity2页面布局:因为采用的是listview的方式,所以在主页面添加ListView,新建list_item2,用于列表内的布局【layout/activity_list2.xml】【layout/list_item2.xml】实现列表:【ListActivity2.java】pa
- 【android】读取通讯录
叨叨凡
android
1.Manifest.xml设置权限2.ContactTestActivity.java代码packagecom.zufe.contacttest;importandroid.app.ListActivity;importandroid.content.ContentResolver;importandroid.database.Cursor;importandroid.os.Bundle;imp
- 继承ListActivity报错的可能原因
gaoya07080122
listviewandroidlist
ListActivity则在布局文件中必须有一个ListView,id必须是"@id/android:list"在AndroidListActivity操作中需要注意的是那个ListView的ID,是系统自定义的android:list,不是我们随便取的,否则系统会说找不到它想要的listview了。这个ListView的id应该是在setContentView(R.xxx.xml)的xxx.xm
- android 数据库 SQLiteOpenHelper和ContentProvider学习笔记---添加修改删除数据之联系人(二)
dany1202
android初阶篇
1.结构化分1)主界面:用来显示数据库列表,并响应menu菜单本程序为GContact.java,其主布局文件为contact_list.xml,其ListView的id必须声明为android:id="@+id/android:list",这样系统才可以在ListActivity里引用的到2)SQLiteOpenHelper类,该类里定义数据库名字:DATABASE_NAME="bbbconta
- android(ListView)
黑夜中奔跑
Android
1.垂直的形式列出需要显示的列表,显示系统设置项或直接使用ListView组件创建,另一种是让Activity继承ListActivity实现ListView是开发中使常见的一个控件,一般会对其进行封装.QQ列表等.2.使用资源文件的listview.2.1XMl文件(lsitview)2.2布局文件(activity_res)2.2values/string下的资源android012芷若无忌敏
- 安卓开发_浅谈ListView(ArrayAdapter数组适配器)
defukwanmcth26174
移动开发java
列表视图(ListView)以垂直的形式列出需要显示的列表项。实现过程:新建适配器->添加数据源到适配器->视图加载适配器在安卓中,有两种方法可以在屏幕中添加列表视图1、直接用ListView组件创建2、让Activity继承ListActivity实现一、xml文件方式创建列表布局文件代码126713141516相应的res/layout中数组资源123xqx_lianxi4/数组资源名称为li
- android学习小结3
jackyrongvip
JAVA相关AndroidSQLite数据结构
1activity可以继承扩展ListActivity比如:classDummyNoteextendsListActivity{privateString[]note_array={"gasolin","crota","louk","magicion"};ListAdapteradapter=newArrayAdapter(this,android.R.layout.simple_list_ite
- android获取指定路径下目录文件
haishizi1
android学习
来自http://aina-hk55hk.iteye.compackagecom.Aina.Android;importjava.io.File;importjava.util.ArrayList;importjava.util.List;importandroid.app.AlertDialog;importandroid.app.ListActivity;importandroid.conte
- Android小项目——实现论坛管理
chao2010686
在android系统中,ListView的用法稍微复杂一点,配置Adpater就有几种方法,如ArrayAdapter,SimpleAdapter等。查了一些网上的相关例子,有很多都是用ListActivity,然後用Adapter来显示布局。本例中没有用到ListActivity。ListView是在android中是一个经常用到的控件,ListView里面的每个子项Item可以使用一个字符串,
- 【Android】如何用MediaPlayer实现一个简单的音视频播放器
Code Talk
Android移动开发android视频播放器
我们在上一篇文章如何实现一个简单的文件浏览器的基础上,使用MeidaPlayer实现对音视频文件的播放功能。主要代码如下:Manifest文件activity_player.xmlMainActiviry.javapackagecom.example.loushuai.simpleplayer;importandroid.app.ListActivity;importandroid.content
- Android 之 Fast Scroll 、字母索引栏
Even_GuangZhou
Android
列表快速滚动,是比较常见的需求,特别是在通讯录上。现在Android好多APP都是字母索引栏,其实字母索引是IOS那边的规范,很多人觉得好用就抄过来了。在Android上原生的是叫FastScroll,特点是默认隐藏的,也没有一排的字母显示出来,只能在划动列表时出现。FastScroll实现方法:继承ListActivity(普通的Activity貌似不行);调用setFastScrollEnab
- android的listactivity实例
caska123321
androidlayoutencodingfilelistviewexception
packagelee.mylist;importjava.io.File;importjava.util.ArrayList;importjava.util.List;importandroid.app.Activity;importandroid.app.ListActivity;importandroid.os.Bundle;importandroid.view.View;importandr
- 如何使listview中的CheckBox被正确选中?
甜tianquan
可以做一个数据model利用adapter和listview关联起来。packagede.vogella.android.listactivity;publicclassModel{privateStringname;privatebooleanselected;publicModel(Stringname){this.name=name;selected=false;}publicStringg
- android 视频缩略图之 MediaStore
小行家
android视频缩略图之MediaStore
首先声明MediaStore是2.0以后才有的类listview.xml如下[html]viewplaincopy1、我先按照参考的第一个url来写的[java]viewplaincopypackagecom.lp;importjava.util.ArrayList;importandroid.app.ListActivity;importandroid.content.Context;impor
- 戴尔笔记本win8系统改装win7系统
sophia天雪
win7戴尔改装系统win8
戴尔win8 系统改装win7 系统详述
第一步:使用U盘制作虚拟光驱:
1)下载安装UltraISO:注册码可以在网上搜索。
2)启动UltraISO,点击“文件”—》“打开”按钮,打开已经准备好的ISO镜像文
- BeanUtils.copyProperties使用笔记
bylijinnan
java
BeanUtils.copyProperties VS PropertyUtils.copyProperties
两者最大的区别是:
BeanUtils.copyProperties会进行类型转换,而PropertyUtils.copyProperties不会。
既然进行了类型转换,那BeanUtils.copyProperties的速度比不上PropertyUtils.copyProp
- MyEclipse中文乱码问题
0624chenhong
MyEclipse
一、设置新建常见文件的默认编码格式,也就是文件保存的格式。
在不对MyEclipse进行设置的时候,默认保存文件的编码,一般跟简体中文操作系统(如windows2000,windowsXP)的编码一致,即GBK。
在简体中文系统下,ANSI 编码代表 GBK编码;在日文操作系统下,ANSI 编码代表 JIS 编码。
Window-->Preferences-->General -
- 发送邮件
不懂事的小屁孩
send email
import org.apache.commons.mail.EmailAttachment;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.HtmlEmail;
import org.apache.commons.mail.MultiPartEmail;
- 动画合集
换个号韩国红果果
htmlcss
动画 指一种样式变为另一种样式 keyframes应当始终定义0 100 过程
1 transition 制作鼠标滑过图片时的放大效果
css
.wrap{
width: 340px;height: 340px;
position: absolute;
top: 30%;
left: 20%;
overflow: hidden;
bor
- 网络最常见的攻击方式竟然是SQL注入
蓝儿唯美
sql注入
NTT研究表明,尽管SQL注入(SQLi)型攻击记录详尽且为人熟知,但目前网络应用程序仍然是SQLi攻击的重灾区。
信息安全和风险管理公司NTTCom Security发布的《2015全球智能威胁风险报告》表明,目前黑客攻击网络应用程序方式中最流行的,要数SQLi攻击。报告对去年发生的60亿攻击 行为进行分析,指出SQLi攻击是最常见的网络应用程序攻击方式。全球网络应用程序攻击中,SQLi攻击占
- java笔记2
a-john
java
类的封装:
1,java中,对象就是一个封装体。封装是把对象的属性和服务结合成一个独立的的单位。并尽可能隐藏对象的内部细节(尤其是私有数据)
2,目的:使对象以外的部分不能随意存取对象的内部数据(如属性),从而使软件错误能够局部化,减少差错和排错的难度。
3,简单来说,“隐藏属性、方法或实现细节的过程”称为——封装。
4,封装的特性:
4.1设置
- [Andengine]Error:can't creat bitmap form path “gfx/xxx.xxx”
aijuans
学习Android遇到的错误
最开始遇到这个错误是很早以前了,以前也没注意,只当是一个不理解的bug,因为所有的texture,textureregion都没有问题,但是就是提示错误。
昨天和美工要图片,本来是要背景透明的png格式,可是她却给了我一个jpg的。说明了之后她说没法改,因为没有png这个保存选项。
我就看了一下,和她要了psd的文件,还好我有一点
- 自己写的一个繁体到简体的转换程序
asialee
java转换繁体filter简体
今天调研一个任务,基于java的filter实现繁体到简体的转换,于是写了一个demo,给各位博友奉上,欢迎批评指正。
实现的思路是重载request的调取参数的几个方法,然后做下转换。
- android意图和意图监听器技术
百合不是茶
android显示意图隐式意图意图监听器
Intent是在activity之间传递数据;Intent的传递分为显示传递和隐式传递
显式意图:调用Intent.setComponent() 或 Intent.setClassName() 或 Intent.setClass()方法明确指定了组件名的Intent为显式意图,显式意图明确指定了Intent应该传递给哪个组件。
隐式意图;不指明调用的名称,根据设
- spring3中新增的@value注解
bijian1013
javaspring@Value
在spring 3.0中,可以通过使用@value,对一些如xxx.properties文件中的文件,进行键值对的注入,例子如下:
1.首先在applicationContext.xml中加入:
<beans xmlns="http://www.springframework.
- Jboss启用CXF日志
sunjing
logjbossCXF
1. 在standalone.xml配置文件中添加system-properties:
<system-properties> <property name="org.apache.cxf.logging.enabled" value=&
- 【Hadoop三】Centos7_x86_64部署Hadoop集群之编译Hadoop源代码
bit1129
centos
编译必需的软件
Firebugs3.0.0
Maven3.2.3
Ant
JDK1.7.0_67
protobuf-2.5.0
Hadoop 2.5.2源码包
Firebugs3.0.0
http://sourceforge.jp/projects/sfnet_findbug
- struts2验证框架的使用和扩展
白糖_
框架xmlbeanstruts正则表达式
struts2能够对前台提交的表单数据进行输入有效性校验,通常有两种方式:
1、在Action类中通过validatexx方法验证,这种方式很简单,在此不再赘述;
2、通过编写xx-validation.xml文件执行表单验证,当用户提交表单请求后,struts会优先执行xml文件,如果校验不通过是不会让请求访问指定action的。
本文介绍一下struts2通过xml文件进行校验的方法并说
- 记录-感悟
braveCS
感悟
再翻翻以前写的感悟,有时会发现自己很幼稚,也会让自己找回初心。
2015-1-11 1. 能在工作之余学习感兴趣的东西已经很幸福了;
2. 要改变自己,不能这样一直在原来区域,要突破安全区舒适区,才能提高自己,往好的方面发展;
3. 多反省多思考;要会用工具,而不是变成工具的奴隶;
4. 一天内集中一个定长时间段看最新资讯和偏流式博
- 编程之美-数组中最长递增子序列
bylijinnan
编程之美
import java.util.Arrays;
import java.util.Random;
public class LongestAccendingSubSequence {
/**
* 编程之美 数组中最长递增子序列
* 书上的解法容易理解
* 另一方法书上没有提到的是,可以将数组排序(由小到大)得到新的数组,
* 然后求排序后的数组与原数
- 读书笔记5
chengxuyuancsdn
重复提交struts2的token验证
1、重复提交
2、struts2的token验证
3、用response返回xml时的注意
1、重复提交
(1)应用场景
(1-1)点击提交按钮两次。
(1-2)使用浏览器后退按钮重复之前的操作,导致重复提交表单。
(1-3)刷新页面
(1-4)使用浏览器历史记录重复提交表单。
(1-5)浏览器重复的 HTTP 请求。
(2)解决方法
(2-1)禁掉提交按钮
(2-2)
- [时空与探索]全球联合进行第二次费城实验的可能性
comsci
二次世界大战前后,由爱因斯坦参加的一次在海军舰艇上进行的物理学实验 -费城实验
至今给我们大家留下很多迷团.....
关于费城实验的详细过程,大家可以在网络上搜索一下,我这里就不详细描述了
在这里,我的意思是,现在
- easy connect 之 ORA-12154: TNS: 无法解析指定的连接标识符
daizj
oracleORA-12154
用easy connect连接出现“tns无法解析指定的连接标示符”的错误,如下:
C:\Users\Administrator>sqlplus username/
[email protected]:1521/orcl
SQL*Plus: Release 10.2.0.1.0 – Production on 星期一 5月 21 18:16:20 2012
Copyright (c) 198
- 简单排序:归并排序
dieslrae
归并排序
public void mergeSort(int[] array){
int temp = array.length/2;
if(temp == 0){
return;
}
int[] a = new int[temp];
int
- C语言中字符串的\0和空格
dcj3sjt126com
c
\0 为字符串结束符,比如说:
abcd (空格)cdefg;
存入数组时,空格作为一个字符占有一个字节的空间,我们
- 解决Composer国内速度慢的办法
dcj3sjt126com
Composer
用法:
有两种方式启用本镜像服务:
1 将以下配置信息添加到 Composer 的配置文件 config.json 中(系统全局配置)。见“例1”
2 将以下配置信息添加到你的项目的 composer.json 文件中(针对单个项目配置)。见“例2”
为了避免安装包的时候都要执行两次查询,切记要添加禁用 packagist 的设置,如下 1 2 3 4 5
- 高效可伸缩的结果缓存
shuizhaosi888
高效可伸缩的结果缓存
/**
* 要执行的算法,返回结果v
*/
public interface Computable<A, V> {
public V comput(final A arg);
}
/**
* 用于缓存数据
*/
public class Memoizer<A, V> implements Computable<A,
- 三点定位的算法
haoningabc
c算法
三点定位,
已知a,b,c三个顶点的x,y坐标
和三个点都z坐标的距离,la,lb,lc
求z点的坐标
原理就是围绕a,b,c 三个点画圆,三个圆焦点的部分就是所求
但是,由于三个点的距离可能不准,不一定会有结果,
所以是三个圆环的焦点,环的宽度开始为0,没有取到则加1
运行
gcc -lm test.c
test.c代码如下
#include "stdi
- epoll使用详解
jimmee
clinux服务端编程epoll
epoll - I/O event notification facility在linux的网络编程中,很长的时间都在使用select来做事件触发。在linux新的内核中,有了一种替换它的机制,就是epoll。相比于select,epoll最大的好处在于它不会随着监听fd数目的增长而降低效率。因为在内核中的select实现中,它是采用轮询来处理的,轮询的fd数目越多,自然耗时越多。并且,在linu
- Hibernate对Enum的映射的基本使用方法
linzx0212
enumHibernate
枚举
/**
* 性别枚举
*/
public enum Gender {
MALE(0), FEMALE(1), OTHER(2);
private Gender(int i) {
this.i = i;
}
private int i;
public int getI
- 第10章 高级事件(下)
onestopweb
事件
index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/
- 孙子兵法
roadrunners
孙子兵法
始计第一
孙子曰:
兵者,国之大事,死生之地,存亡之道,不可不察也。
故经之以五事,校之以计,而索其情:一曰道,二曰天,三曰地,四曰将,五
曰法。道者,令民于上同意,可与之死,可与之生,而不危也;天者,阴阳、寒暑
、时制也;地者,远近、险易、广狭、死生也;将者,智、信、仁、勇、严也;法
者,曲制、官道、主用也。凡此五者,将莫不闻,知之者胜,不知之者不胜。故校
之以计,而索其情,曰
- MySQL双向复制
tomcat_oracle
mysql
本文包括:
主机配置
从机配置
建立主-从复制
建立双向复制
背景
按照以下简单的步骤:
参考一下:
在机器A配置主机(192.168.1.30)
在机器B配置从机(192.168.1.29)
我们可以使用下面的步骤来实现这一点
步骤1:机器A设置主机
在主机中打开配置文件 ,
- zoj 3822 Domination(dp)
阿尔萨斯
Mina
题目链接:zoj 3822 Domination
题目大意:给定一个N∗M的棋盘,每次任选一个位置放置一枚棋子,直到每行每列上都至少有一枚棋子,问放置棋子个数的期望。
解题思路:大白书上概率那一张有一道类似的题目,但是因为时间比较久了,还是稍微想了一下。dp[i][j][k]表示i行j列上均有至少一枚棋子,并且消耗k步的概率(k≤i∗j),因为放置在i+1~n上等价与放在i+1行上,同理