- 博客(14)
- 问答 (1)
- 收藏
- 关注
原创 RabbitMQ报错 o.s.a.r.c.CachingConnectionFactory : Channel shutdown: channel error; protocol meth
我这边是没有开启手动ack(其实是开启错了,SimpleMessageListenerContainer的配置配到DirectMessageListenerContainer上去了,也就是xxx.simple.acknowledge-mode配成xxx.direct.acknowledge-mode),代码里又调用了channel.basicAck()所以报这个错。...
2020-03-07 21:08:52
7451
原创 Android网络:发送http请求
一、用WebView来显示一个网页当然是先要通过findViewById来实例化WebView的对象webview,然后就是调用几个方法webview.getSetting().setJavaScriptEnable(ture);//让webview支持javascript脚本,当然通过调用不同的方法可以支持一些其他的脚本webview.setWebViewClient(new Web
2017-09-24 18:42:29
1224
原创 Android使用通知
首先是获取NotificationManager的实例:NotificationManager manager = (NotificationManger) getSystemService(Content.NOTIFICATION_SERVICE);然后用一个Builder构造器来创建Notification对象:Notification notification = new Nof
2017-09-23 10:45:18
349
原创 Android:在程序运行时申请权限(第一行代码android)
这里以设计一个按钮以拨打电话为例子拨打电话必须在Android.Manifest.xml中声明权限拨打电话的函数:public void call(){ try{ Intent intent = new Intent(Intent.Action_CALL); intent.setData(Uri.parse("tel:10086"));
2017-09-22 16:48:48
790
原创 Andoird:用LitePal操作数据库(第一行代码Android学习)
配置LitePal:①编辑app/build.gradle文件,在dependencies{}中添加代码:compile 'org.litepal.android:core:1.6.0(版本号)',查询最新版本号,官网:https://github.com/LitePalFramework/LitePal②在main下新建一个目录assets,在该目录下创建一个litepal.xml文件,
2017-09-21 15:39:36
833
原创 android SQLite数据库:创建及更新
一个Book的建表语句create table Book( id integer primary key autoincrement, //id是主键,autoincrement表示id是自增长的 author text, pages integer, price real, name text) 前面的字符串表示数据id,后面的表示数据类
2017-09-19 21:05:23
570
原创 Android广播:实现强制下线功能(第一行代码Android学习)
首先是要创建一个类用来管理所有活动的启动销毁等,把它命名为AcitivityCollector代码:public class ActivityCollector { public static List activities = new ArrayList<>(); public static void addAcitivity(Activity activity){
2017-09-16 20:09:57
518
原创 android广播:自定义广播(第一行代码android学习)
1.标准广播新建一个项目1,新建一个BraodcastReceiver叫BraodcastReceiver1注册方法: 假如要用一个Button来接收广播public onClick(View v){ Intent intent = new Intent("com.example.包名.自定义广播名");
2017-09-15 20:54:04
445
转载 android广播:静态注册实现开机启动(第一行代码android学习)
快速创建广播接收器的方法:右击java目录下的当前包名→New→otherBroadcast Receiver.(快捷方式创建的广播接收器已经自动完成注册)在自动构建的onReceive方法中添加代码:Toast.makeText(context,"...(开机时广播的内容)",Toast.LENGTH_SHORT).show();在AndroidMainfest.xml添加如下代码:
2017-09-15 20:01:48
1438
原创 android广播:动态注册监听网络变化(第一行代码android学习笔记)
public class MainActivity extends AppCompatActivity { private IntentFilter intentFilter; private NetworkChangeReceiver networkChangeReceiver; @Override protected void onCreate(Bundle
2017-09-15 16:40:56
647
原创 RecyclerView的基本用法(第一行代码android学习笔记)
首先在build.guide中添加代码:compile 'com.android.support.support:recyclerview-v7:(Android API版本 如26.0.0 )'然后在布局中应用: android:id=... //长宽等各种属性 />用RecyclerV
2017-09-14 19:31:10
719
转载 android控件属性大全
android控件的属性android控件的属性本节描述android空间的位置,内容等相关属性及属性的含义第一类:属性值为true或falseandroid:layout_centerHrizontal 水平居中 (Hrizontal表示水平)android:layout_centerVertical 垂直居中 (Vertiacl表示垂直)an
2017-09-14 19:29:37
517
原创 android启动活动(第一行代码android学习笔记)
如需启动SecondAcitivity:public class SecondActivity extends BaseActivity{ public static void actionStart(Context context,String data1,String data2){ Intent intent = new Intent(context,Seco
2017-09-14 19:16:59
294
原创 android button点击事件(第一行代码android学习笔记)
1.Button button = (Button) findViewById(R.id.button);button.setOnClickListener(new View.OnClickListener(){ @Override public void onClick(View v){ //...}});2.当前类实现接口
2017-09-14 19:07:10
412
空空如也
jsp界面中引入jsp文件问题。
2017-11-14
TA创建的收藏夹 TA关注的收藏夹
TA关注的人