- 博客(8)
- 收藏
- 关注
原创 Android Intent跨进程通信
Bundle bundle = new Bundle();bundle.putString("test","来自A");Intent intent = new Intent(Intent.ACTION_MAIN);intent.addCategory(Intent.CATEGORY_LAUNCHER);ComponentName componentName = new ComponentName("com.example.test", "com.example.test.Main2Activity"
2021-08-27 19:14:09
422
原创 Android GreenDao模糊查询
GreenDao模糊查询 val myUserDao = DaoMaster(DaoMaster.DevOpenHelper(this, "user") .writableDatabase).newSession().myUserDao val list = myUserDao.queryBuilder() .where(MyUserDao.Properties.Username.like("%"+username.text.toString()+"%"), MyUserDao.Prop
2021-08-25 15:05:47
702
原创 android 获取屏幕尺寸
private void getScreenSize(){ //获取屏幕分辨率 DisplayMetrics metric=new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(metric); int width=metric.widthPixels; // 宽度(PX) int height=metric.heightPixels; // 高度(PX) float
2021-08-25 15:03:11
409
原创 android 带返回键的页面
public class BaseBackActivity extends BaseActivity { @Override protected void onCreate( Bundle savedInstanceState) { super.onCreate(savedInstanceState); //显示返回键 if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){
2021-07-06 16:59:07
108
原创 anroid Fragment优化与切换
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_height="match_parent" android:orientation="vertical"> &
2021-06-30 15:37:07
111
原创 android自定义拖拽验证框
public class TouchPictureV extends View { private Bitmap bgBitmap;//背景 private Paint mPaintbg;//背景画笔ull private Bitmap mNullBitmap;//空白快 private Paint mPaintNull;//空白块画笔 private Bitmap mMoveBitmap;//移动方块 private Paint mPaintMove;//移
2021-06-29 14:34:07
187
原创 android权限管理
权限管理public class BaseActivity extends AppCompatActivity { //申明所需权限,将所需申请权限放于此处 private String[] mStrPermissions={ Manifest.permission.READ_PHONE_STATE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permis
2021-06-29 14:27:12
136
原创 android Dialog对话框
Dialog对话框对话框常用对话框普通对话框单选对话框多选对话框自定义对话框日期对话框时间对话框水平对话框自定义对话框2对话框常用对话框普通对话框AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);//创建对话框构建者 builder.setTitle("标题");//设置标题 builder.setMessage("内容");//设置内容
2020-12-07 16:32:25
107
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人