自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 android-创建数据库存入数据,数据库数据的增删改查

方法不统一,会有很多很多方法,我的只是其中的一种呢首先先在布局文件里写入四个按钮 分别是 增删改查实现是点击按钮触发onClick完成的 <Button android:onClick="add" android:text="增" android:layout_width="wrap_content" android:layout_height="wrap_content"> </Button>

2021-06-01 11:19:49 1302 1

原创 android-数据存入SP SP读取数据(简单案例)

首先是布局文件里有两个按钮接下来显示写入SP的onClick public void writeSp(View view) { //获取Sp对象 //参数一 文件名 参数二 模式(固定写法) SharedPreferences sp = getSharedPreferences("day8",MODE_PRIVATE); //编辑者 SharedPreferences.Editor edit = sp.edit(

2021-06-01 11:02:13 1411

原创 android-Banner控件的简单轮播图

实现这个轮播图是在Fragment里实现的,所以要想实现,首先要创建Fragment首先是布局文件中的展示<com.youth.banner.Banner android:id="@+id/banner" android:layout_width="match_parent" android:layout_height="500dp"> </com.youth.banner.Banner>下面是Fragment里的代

2021-05-26 15:08:26 211

原创 android- ViewPager的跳转Fragment

首先先在布局文件创建ViewPager <androidx.viewpager.widget.ViewPager android:orientation="vertical" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="9" android:id="@+id/main">.

2021-05-26 09:24:49 382

原创 java-android 点击两次返回按钮退出

首先先定义一个全局变量 a 然后在运用onKeyDown事件 long = 0; //默认第一次是0 //1双击回退按钮,退出,单击回退按钮,提示在点击一次退出 //点击两次退出 @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode==KeyEvent.KEYCODE_BACK) { //获取当前时间 .

2021-05-24 14:39:53 160

原创 java--android--Notification.Builder

基础自定义通知 //构建者 Notification.Builder builder = new Notification.Builder(this); //设置属性 builder.setSmallIcon(R.drawable.ic_launcher_background);//小图标 必须要有 //加载布局 RemoteViews remoteViews = new RemoteViews(getPackage

2021-05-22 09:21:34 216 1

原创 java--android--PopupWindow

简单弹窗PopupWindow //弹框t PopupWindow popupWindow = new PopupWindow(); //宽高必须要有 popupWindow.setWidth(ViewGroup.LayoutParams.MATCH_PARENT); popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT); //点击外部取消 popupWindow.setOutsid

2021-05-22 09:11:58 147 5

原创 java--android系统菜单

简单的系统菜单首先先要在res里创建一个菜单布局(menu)<?xml version="1.0" encoding="utf-8"?><menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/one" android:title="选项一"></item> <item android:id="@+id/two"

2021-05-21 09:27:29 97

原创 android对话框

android对话框普通对话框单选对话框多选对话框进度条对话框日期对话框时间对话框自定义对话框自定义对话框最常用(点击按钮 触发onClick 实现对话框)普通对话框 //普通对话框 public void tion1(View view) { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setIcon(R.drawable.ic_launcher_backgr

2021-05-20 14:47:36 87

空空如也

空空如也

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

TA关注的人

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