自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(85)
  • 收藏
  • 关注

转载 Android实现欢迎界面的自动跳转

Android实现欢迎界面的自动跳转,就是打开某一个安卓手机应用,出现的欢迎界面停留几秒钟,自动进入应用程序的主界面。在网上看到很多种实现办法,但是感觉这种方法还是比较简单的。在onCreate里设置个Timer,然后建立Intent指向你要调用Activity。设置Timer 10妙后执行startActivity就行了。 示例代码:protected void onCreate(Bundle ...

2018-06-30 13:48:49 2027

转载 Android 欢迎全屏图片详解及实例代码

Android 欢迎全屏图片详解 其实欢迎界面就是在主Activity之前再添加一个欢迎的Activity。在这个Activity中实现欢迎界面,和其他的Activity用法是基本一样,只有细微的差别。    1、在Activity的onCreate方法中实现:?123456789@Overrideic void onCreate(Bundle savedInstanceState) { supe...

2018-06-30 13:38:38 476

原创 Android之DialogFragment

activity_main.xml<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:la...

2018-06-30 12:09:56 128

原创 Android之Fragment的替换

fragment_demo.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_hei...

2018-06-29 22:25:59 1742

原创 Android之Fragment动态添加和移除Fragment

fragment_demo.xml<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_hei...

2018-06-29 19:26:52 5927 6

原创 安卓的多线程,在实际操作中,到底有什么用处

多线程是相对UI主线程而言的。用户操作涉及到处理文件IO,网络IO的耗时操作时,新开线程异步处理的方法能避免UI线程被阻塞,界面才不会无法响应,影响用户体验。android流畅度没有iOS高,不是因为字节码,因为现代java虚拟机有热点探测技术,会把频繁执行的字节码编译成和c一样的机器码。不流畅的原因是java有垃圾回收机制(GC),无论什么类型的GC,总是会有stop the world的停顿。...

2018-06-28 18:41:06 968

原创 Android之Intent实现携带参数跳转并返回值

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...

2018-06-28 17:53:42 7774 1

原创 Android之Intent携带参数跳转到指定的Activity并取出值显示在UI页面

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...

2018-06-28 16:11:16 2532

原创 Android之调用联系人

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...

2018-06-28 13:53:15 222

原创 Android之通过category跳转到指定的Activity

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...

2018-06-28 13:36:07 364

原创 Android之隐式启动通过action跳转到指定的Activity

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...

2018-06-28 12:44:26 7341

原创 Andriod之用Intent实现Activity之间的跳转

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...

2018-06-28 12:25:03 193

原创 Andrios之spinner的级联应用

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...

2018-06-27 22:34:31 111

原创 Android之动态改变适配器数据源

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...

2018-06-27 18:22:39 1468

原创 Android之GridView和BaseAdapter

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...

2018-06-27 17:36:05 355

原创 Android之BaseAdapter

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...

2018-06-26 23:35:42 82

原创 Android之BaseAdapter

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...

2018-06-26 21:20:16 96

原创 Android的SimpleAdapter适配器和List的配合的使用

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...

2018-06-26 19:32:23 359

原创 Android适配器

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...

2018-06-26 16:49:52 90

原创 Android自定义对话框

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...

2018-06-26 13:06:39 93

原创 Android 进度条

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...

2018-06-25 23:04:55 108

原创 Android 列表单选对话框

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="matc...

2018-06-25 21:51:30 1651

原创 Android 列表多选对话框

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...

2018-06-25 21:47:35 2960

原创 Android 列表对话框

package com.example.test9;import android.support.v7.app.ActionBarActivity;import android.app.AlertDialog;import android.content.DialogInterface;import android.os.Bundle;import android.view.Menu;...

2018-06-25 17:57:06 1505

原创 Android的消息提示AlertDialog

package com.example.test8;import android.support.v7.app.ActionBarActivity;import android.app.AlertDialog;import android.content.DialogInterface;import android.os.Bundle;import android.view.Gravi...

2018-06-25 14:00:08 137

转载 Android中MainActivity.this和this的区别

本质上是没区别的.但是有时候必须要用MainActivity.this 这样的,比如某个控件 setOnClickListener(); 在括号里面new 一个OnClickListener ,然后在onClick方法里面处理的时候必须要用MainActivity.this 而不能用this.表示的就是MainActivity这个类对象本来,这种写法一般用在内部类里,因为在外部类中直接可以用关键字...

2018-06-25 13:51:41 2414

原创 Android的消息提示Toast

Toast消息提示的三种方法package com.example.test8;import android.support.v7.app.ActionBarActivity;import android.os.Bundle;import android.view.Gravity;import android.view.LayoutInflater;import android.vie...

2018-06-25 12:39:57 148

原创 Android的线程机制

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_...

2018-06-24 23:49:35 340

原创 Handler的消息传递机制

2018-06-24 22:35:45 183

原创 Android滚动条

横向滚动条<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_heig...

2018-06-24 18:54:38 1863

原创 Android侧边栏

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    androi...

2018-06-24 17:59:54 634

原创 Java中字符串indexof() 的使用方法

Java中字符串中子串的查找共有四种方法(indexof())  indexOf 方法返回一个整数值,指出 String 对象内子字符串的开始位置。如果没有找到子字符串,则返回-1。如果 startindex 是负数,则 startindex 被当作零。如果它比最大的字符位置索引还大,则它被当作最大的可能索引。Java中字符串中子串的查找共有四种方法,如下:1、int indexOf(String...

2018-06-23 21:25:33 213

原创 java中的switch case语句

java中的switch case语句 switch-case语句格式如下:switch(变量){case 变量值1: //; break;case 变量值2: //...; break; ...case default: //...; break;}swtich()变量类型只能是int、short、char、byte和enum类型(JD...

2018-06-23 12:31:51 495

原创 Mysql 如何设置字段自动获取当前时间

应用场景: 1、在数据表中,要记录每条数据是什么时候创建的,不需要应用程序去特意记录,而由数据数据库获取当前时间自动记录创建时间;2、在数据库中,要记录每条数据是什么时候修改的,不需要应用程序去特意记录,而由数据数据库获取当前时间自动记录修改时间; 实现方式: 1、将字段类型设为  TIMESTAMP 2、将默认值设为  CURRENT_TIMESTAMP 举例应用: 1、MySQL 脚本实现用例...

2018-06-22 11:12:49 135

转载 MySQL 中的数据类型介绍

   据我统计,MySQL支持39种(按可使用的类型字段统计,即同义词也作多个)数据类型。下面的介绍可能在非常古老的mysql版本中不适用。    转载请注明出处:http://blog.csdn.net/anxpp/article/details/51284106。谢谢!    文本主要参考了官方文档:http://dev.mysql.com/doc/refman/5.7/en/ 1、概述   ...

2018-06-22 10:56:57 107

原创 Java连接MySQL数据库,中文乱码问题

今天遇到了将数据存到MySQL数据库,出现中文乱码的问题,查了很多的网上的资料,一次次尝试才解决。整个人的头都大了,差点放弃,幸好坚持下来了,最终问题解决,非常高兴,怕自己忘了,记下来。第一步;用eclipse调试工具DeBug检查传递到servlet的参数,是否出现乱码。解决方法://在servlet中设置编码方式 request.setCharacterEncoding("utf-8"); ...

2018-06-20 23:17:04 592

转载 在Tomcat中部署Web项目的操作方法(必看篇)

下面小编就为大家带来一篇在Tomcat中部署Web项目的操作方法(必看篇)。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧在这里介绍在Tomcat中部署web项目的三种方式:1.部署解包的webapp目录2.打包的war文件3.Manager Web应用程序一:部署解包的webapp目录将Web项目部署到Tomcat中的方法之一,是部署没有封装到WAR文件中的Web项...

2018-06-20 13:48:30 663

转载 eclipse中将项目打包成war的方法

war包即Web归档文件,将Web项目打成war包可以直接拷贝到Web服务器发布目录(例如Tomcat服务器webapps目录 ),当Tomcat启动后该压缩文件自动解压,war包方便了web工程的发布,那么在Eclipse中如何将Web项目打成war包呢?          1、有如下venus工程:          2、鼠标选中venus工程并点击鼠标右键,出现下图:          3、...

2018-06-20 12:45:09 732

原创 域名怎么解析到服务器上

今天无事说一说如何把自己的域名解析绑定到自己的服务器上。让访客们可以通过你的域名来访问你的网站。域名解析定义域名解析是把域名指向网站空间IP,让人们通过注册的域名可以方便地访问到网站的一种服务。IP地址是网络上标识站点的数字地址,为了方便记忆,采用域名来代替IP地址标识站点地址。域名解析就是域名到IP地址的转换过程。域名的解析工作由DNS服务器完成。以阿里的云虚拟主机来演示1、登录你的阿里云帐号,...

2018-06-20 12:32:02 34239 1

原创 tomcat如何绑定域名和IP

我们开发完程序后经常会遇到在服务器上绑定IP地址和域名的情况,之前我们都是访问http://localhost:8080/项目名称/。这篇文章就是设置一下之后就能通过域名或者IP进行访问了。工具/原料apache-tomcat-6.0.47方法/步骤修改端口号:在访问过程中只有80端口才是默认的端口,不用添加端口访问的。现在我们先来修改端口号。tomcat默认端口为8080.我们改成80.找到to...

2018-06-20 12:27:54 7896

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除