- 博客(19)
- 收藏
- 关注
原创 跨进程存取数据
存:public void putString(Context context, String key, String value) { SharedPreferences settings = context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_WORLD_READABLE|Context.MODE_MULTI_PR
2016-01-19 10:56:58
422
原创 应用未打开时,静态广播的接受
在应用还没打开时,如果静态广播想要接受到消息,则在发送广播时,需要加上intent.setFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
2015-12-22 16:37:53
719
原创 在广播中启动activity或者dialog
启动activity Intent intent1=newIntent(context,main.class);intent1.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);context.startActivity(intent1);一定要设在flag,不然会报错2.打开dialog dialog=new Dialog(context); dialo
2015-12-22 16:04:04
2756
转载 android 设置全屏与非全屏
全屏:getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);退出全屏:getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
2015-11-16 10:26:05
490
转载 android 动画
/** * 滚动发生时 */ @Override protected void onScrollChanged(int l, int t, int oldl, int oldt) { super.onScrollChanged(l, t, oldl, oldt); float scale=l*1.0f/mMenuWidth;
2015-10-26 15:19:19
260
原创 自定义属性
一、书写xml 1.在value文件夹下面新建attr.xml<?xml version="1.0" encoding="utf-8"?><resources> <declare-styleable name="SlideMenu"> <attr name="rightPadding" format="dimension"></attr> </dec
2015-10-26 11:44:03
290
转载 android ActionBar的使用(模仿微信界面)
修改menu 文件下的main.xml<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context="com.ll.testactionbar.MainActivity" > <item
2015-10-22 19:52:39
471
原创 遍历所有文件夹,并找出相符的文件
public static List<String> scanFile(String path) { File file=new File(path); File[] files = file.listFiles(); if(files!=null){ for(File f:files){
2015-10-12 15:02:31
336
原创 获取所有应用程序的信息 显示并打开相关的程序
pm = getPackageManager();Intent intent=new Intent(Intent.ACTION_MAIN, null);intent.addCategory(Intent.CATEGORY_LAUNCHER);List<ResolveInfo> list = pm.queryIntentActivities(intent, PackageManager.GET
2015-09-28 17:20:52
500
原创 文章标题
因此只要在manifest中具备这样的intent-filter都可以在开机的时候作为Home启动: <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.HOME"/>
2015-09-28 17:04:24
230
原创 activity强制设置为横屏
在AndroidManifest.xml 对应的acticity中添加属性android:screenOrientation="landscape"
2015-09-25 15:20:15
312
原创 去掉和隐藏应用
去掉应用 找到应用的apk,将应用中Android.mk文件的文件名改为:Android.mk.bak隐藏应用 修改应用的AndroidManifest.xml文件 将<category android:name="android.intent.category.LAUNCHER" />修改为<category android:name="android.intent.category.DE
2015-09-24 15:18:59
562
原创 从服务器上更新代码后编译文件并打包
更新代码git push origin 分支名更新新的版本后,需要执行make update -api. 不然会出现如下错误:You have tried to change the API from what has been previously approved.To make these errors go away, you have two choices: 1) You
2015-09-24 15:03:24
791
转载 Ubtuntu 使用快捷键打开命令行窗口
打开命令行窗口:Ctrl+Alt+T在打开的窗口中再打开一个新的窗口:Ctrl+Shift+T在同一窗口的Tab间切换:Ctrl+ Page Up
2015-09-24 11:34:17
845
原创 SeerBar样式
<SeekBar android:layout_width="920dp" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:maxHeight="
2015-09-24 09:40:55
670
转载 android 设置系统的时间
在Android中,API 提供SystemClock.setCurrentTimeMills()函数来修改系统时间,但logcat会提示:“Unable to open alarm driver:Permission denied”.这个函数需要root权限或者运行在系统进程中才可以使用。解决办法:在应用程序的AndroidManifest.xml中的 manifest节点中加入android:
2015-09-22 10:04:44
952
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人