05 2016 档案

摘要:在使用json_encode之前把字符用函数urlencode()处理一下,然后再json_encode,输出结果的时候在用函数urldecode()转回来 阅读全文
posted @ 2016-05-27 11:00 zqxLonely 阅读(190) 评论(0) 推荐(0)
摘要:如果楼主用phpmyadmin的话,把库,表,字段的整理统一设置为utf8_unicode_ci。 然后取数据时务必SET NANES UTF8; 不是UTF-8!!切记!我以前就范过这个错误,也是显示问号。 显示数据的网页那里设置为 然后。。。就没有然后了。。亲身经历把问号变为正常中文。 作者:AnewG 链接:http://www.zhihu.com/question/2037605... 阅读全文
posted @ 2016-05-27 10:43 zqxLonely 阅读(132) 评论(0) 推荐(0)
摘要:http://www.2cto.com/kf/201604/499617.html 阅读全文
posted @ 2016-05-24 17:36 zqxLonely 阅读(120) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import java.util.Timer; import java.util.TimerTask; public class ... 阅读全文
posted @ 2016-05-21 14:15 zqxLonely 阅读(2097) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.util.AttributeSet; import ... 阅读全文
posted @ 2016-05-21 11:52 zqxLonely 阅读(681) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2016-05-21 10:47 zqxLonely 阅读(330) 评论(0) 推荐(0)
摘要:android:gravity: 这个是针对控件里的元素来说的,用来控制元素在该控件里的显示位置。例如,在一个Button按钮控件中设置如下两个属性, android:gravity="left"和android:text="提交",这时Button上的文字“提交”将会位于Button的左部。 android:layout_gravity: 这个是针对控件本身而言,用来控制该控件在包含该控件的... 阅读全文
posted @ 2016-05-20 20:40 zqxLonely 阅读(134) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2016-05-20 16:01 zqxLonely 阅读(128) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.TextView; pub... 阅读全文
posted @ 2016-05-20 15:23 zqxLonely 阅读(259) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2016-05-20 14:24 zqxLonely 阅读(179) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.util.Log; /** * Created by Administrator on 2016/5/20 0020. */ public class LogUtil { public static final int VERBOSE=1; public static final ... 阅读全文
posted @ 2016-05-20 12:33 zqxLonely 阅读(785) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.os.Parcel; import android.os.Parcelable; import java.io.Serializable; /** * Created by Administrator on 2016/5/20 0020. */ public class Person imple... 阅读全文
posted @ 2016-05-20 12:17 zqxLonely 阅读(546) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class IndexActivity extends AppCompatActivity { @... 阅读全文
posted @ 2016-05-20 12:05 zqxLonely 阅读(460) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.app.Application; import android.content.Context; /** * Created by Administrator on 2016/5/20 0020. */ public class MyApplication extends Application{... 阅读全文
posted @ 2016-05-20 11:52 zqxLonely 阅读(216) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android... 阅读全文
posted @ 2016-05-20 11:17 zqxLonely 阅读(219) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android... 阅读全文
posted @ 2016-05-20 11:00 zqxLonely 阅读(329) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android... 阅读全文
posted @ 2016-05-20 10:54 zqxLonely 阅读(208) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.content.Context; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.... 阅读全文
posted @ 2016-05-19 18:27 zqxLonely 阅读(919) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; /** * Created by... 阅读全文
posted @ 2016-05-19 15:18 zqxLonely 阅读(549) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; /** * Created by Administrator on 2016/5/19 0019. */ public class App { private String id; private String version; private String name; public Strin... 阅读全文
posted @ 2016-05-19 14:45 zqxLonely 阅读(1627) 评论(0) 推荐(0)
摘要:http://jingyan.baidu.com/article/e6c8503c7190b7e54f1a1893.html 阅读全文
posted @ 2016-05-19 14:37 zqxLonely 阅读(282) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import org.... 阅读全文
posted @ 2016-05-19 14:14 zqxLonely 阅读(259) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.util.Log; import org.xml.sax.Attributes; import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; /** * Created by Administrator o... 阅读全文
posted @ 2016-05-19 12:24 zqxLonely 阅读(299) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.content.Intent; import android.os.Handler; import android.os.Message; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import ... 阅读全文
posted @ 2016-05-19 11:59 zqxLonely 阅读(196) 评论(0) 推荐(0)
摘要:在cmd下输入ipconfig,查看无线局域网中ipv4地址 阅读全文
posted @ 2016-05-19 11:57 zqxLonely 阅读(276) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.content.Intent; import android.os.Handler; import android.os.Message; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import ... 阅读全文
posted @ 2016-05-19 10:59 zqxLonely 阅读(120) 评论(0) 推荐(0)
摘要:http://www.veryhuo.com/a/view/109974.html 阅读全文
posted @ 2016-05-19 10:45 zqxLonely 阅读(187) 评论(0) 推荐(0)
摘要:在build.gradle中的android {}中加上useLibrary 'org.apache.http.legacy' 阅读全文
posted @ 2016-05-19 10:22 zqxLonely 阅读(877) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.content.Intent; import android.os.Handler; import android.os.Message; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import ... 阅读全文
posted @ 2016-05-19 10:02 zqxLonely 阅读(255) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import and... 阅读全文
posted @ 2016-05-18 19:01 zqxLonely 阅读(497) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.app.IntentService; import android.content.Intent; import android.content.Context; import android.util.Log; /** * An {@link IntentService} subclass for... 阅读全文
posted @ 2016-05-18 18:12 zqxLonely 阅读(2174) 评论(0) 推荐(0)
摘要:public class MainActivity extends AppCompatActivity implements View.OnClickListener { private Context mContext; private NotificationManager mNManager; private Notification notify1; B... 阅读全文
posted @ 2016-05-18 17:57 zqxLonely 阅读(255) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.annotation.TargetApi; import android.app.Notification; import android.app.PendingIntent; import android.app.Service; import android.content.Intent; impo... 阅读全文
posted @ 2016-05-18 17:55 zqxLonely 阅读(201) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.app.Service; import android.content.Intent; import android.os.Binder; import android.os.IBinder; import android.util.Log; public class MyService extend... 阅读全文
posted @ 2016-05-18 17:35 zqxLonely 阅读(230) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.os.AsyncTask; import android.widget.ProgressBar; import android.widget.TextView; /** * Created by Administrator on 2016/5/18 0018. */ class MyAsyncTa... 阅读全文
posted @ 2016-05-18 16:06 zqxLonely 阅读(176) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.os.Handler; import android.os.Message; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import andro... 阅读全文
posted @ 2016-05-18 15:19 zqxLonely 阅读(176) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.net.Uri; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.MediaController; import android.widget.VideoVi... 阅读全文
posted @ 2016-05-18 14:50 zqxLonely 阅读(207) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.media.MediaPlayer; import android.os.Environment; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; i... 阅读全文
posted @ 2016-05-18 10:58 zqxLonely 阅读(9497) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.annotation.TargetApi; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.... 阅读全文
posted @ 2016-05-18 10:26 zqxLonely 阅读(284) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.annotation.TargetApi; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.... 阅读全文
posted @ 2016-05-18 10:12 zqxLonely 阅读(244) 评论(0) 推荐(0)
摘要:package com.pingyijinren.test; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import... 阅读全文
posted @ 2016-05-17 11:52 zqxLonely 阅读(248) 评论(0) 推荐(0)
摘要:在fragment中使用getActivity()即可获取activity的引用 阅读全文
posted @ 2016-05-12 17:13 zqxLonely 阅读(1256) 评论(0) 推荐(0)
摘要:在android开发中,写了一个关于继承Fragment的类时,如果有重载构造函数时,会提示“Avoid non-default constructors in fragments: use a default constructor plus Fragment#setArguments(Bundl 阅读全文
posted @ 2016-05-12 11:27 zqxLonely 阅读(160) 评论(0) 推荐(0)
摘要:设置webview可以获取截图: 当要进行多次截图时,先要清除之前的缓存: 保存webview的截图到bitmap: 阅读全文
posted @ 2016-05-11 14:22 zqxLonely 阅读(425) 评论(0) 推荐(0)
摘要:学习Java的童鞋们都知道,Java的包、类、借口、方法、变量、常量;JavaEE的三层模型等都有一套约定俗成的命名规则。 我学习每种语言都会关注相应的命名规则,一则体现自己比较专业;二来方便后检查,看到名称就知道是属于什么类型、占用多少内存、使用是否正确等;三又可以供其他人参考。 当然,学习Jav 阅读全文
posted @ 2016-05-09 11:42 zqxLonely 阅读(14606) 评论(0) 推荐(1)
摘要:注意要添加权限: 阅读全文
posted @ 2016-05-07 19:32 zqxLonely 阅读(193) 评论(0) 推荐(0)
摘要:设置支持js: 设置无图模式: 设置文字大小: 阅读全文
posted @ 2016-05-07 18:24 zqxLonely 阅读(337) 评论(0) 推荐(0)
摘要:alertdialogbuilder=new AlertDialog.Builder(MainActivity.this); View view=getLayoutInflater().inflate(R.layout.layout_alertdialog,null,false); alertdialogbuilder.setVie... 阅读全文
posted @ 2016-05-07 13:27 zqxLonely 阅读(144) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2016-05-07 11:17 zqxLonely 阅读(152) 评论(0) 推荐(0)
摘要:package com.example.administrator.myapplication; import android.content.Context; import android.content.SharedPreferences; /** * Created by Administrator on 2016/5/7 0007. */ public class Browser... 阅读全文
posted @ 2016-05-07 10:29 zqxLonely 阅读(183) 评论(0) 推荐(0)
摘要:在webview中,我们需要获取网站的favicon.ico图标,但是默认状态下,WebChromeClient中的onReceivedIcon方法获取到的icon总是为null;webview.getFavicon();获得到的还是null,这个就奇怪了,于是经过一番google,发现老外也遇到了 阅读全文
posted @ 2016-05-06 17:52 zqxLonely 阅读(1262) 评论(0) 推荐(0)
摘要:前一个activity跳转到后一个activity设置code: 重写前一个activity的onActivityResult方法: 后一个activity跳转到前一个activity设置code: 阅读全文
posted @ 2016-05-06 15:54 zqxLonely 阅读(381) 评论(0) 推荐(0)
摘要:设置从当前页面打开链接,而不是跳转到系统默认浏览器打开: 阅读全文
posted @ 2016-05-06 11:42 zqxLonely 阅读(310) 评论(0) 推荐(0)
摘要:SQLite操作类: SQLite初始化: SQLite插入数据: SQLite查询数据: 阅读全文
posted @ 2016-05-05 17:02 zqxLonely 阅读(282) 评论(0) 推荐(0)
摘要:Calendar calendar=Calendar.getInstance(); //获取当前时间,作为图标的名字 String year=calendar.get(Calendar.YEAR)+""; String month=calendar.get(Calendar.MONTH)+1+""; String day=... 阅读全文
posted @ 2016-05-05 16:48 zqxLonely 阅读(11518) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2016-05-05 16:18 zqxLonely 阅读(139) 评论(0) 推荐(0)
摘要:listview_bookmark.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { ... 阅读全文
posted @ 2016-05-05 15:33 zqxLonely 阅读(1291) 评论(0) 推荐(0)
摘要:public void onItemClick(AdapterView<?> arg0, View view, int position, long arg3) X, Y两个listview,X里有1,2,3,4这4个item,Y里有a,b,c,d这4个item。 如果你点了b这个item。如下: 阅读全文
posted @ 2016-05-05 15:27 zqxLonely 阅读(2298) 评论(0) 推荐(0)
摘要:重写viewbinder 再给simpleadapter设置viewbinder 阅读全文
posted @ 2016-05-05 15:04 zqxLonely 阅读(434) 评论(0) 推荐(0)
摘要:String sdcard_path=Environment.getExternalStorageDirectory().getCanonicalPath(); String file_path=sdcard_path+"/xinyuelantu/browser/favicon/test.jpg"; bitmap= BitmapFactory.de... 阅读全文
posted @ 2016-05-05 15:01 zqxLonely 阅读(620) 评论(0) 推荐(0)
摘要:if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { //判断sdcard是否存在和是否具有读写权限 try{ String sdcard_path = Environment.getExternalSto... 阅读全文
posted @ 2016-05-05 15:00 zqxLonely 阅读(208) 评论(0) 推荐(0)