`
文章列表

学习代码

http://www.oschina.net/code/list_releted_codes?id=6080&p=1
Android图片缩放总结及比较 原文链接:http://www.linuxidc.com/Linux/2011-08/40109.htm     使用Matrix类对图片进行 等比例缩放和旋转: // 加载需要操作的图片 Bitmap bitmapOrg = BitmapFactory.decodeResource(getResources(), R.drawable.default_screen); // 获取这个图片的宽和高 int width = bitmapOrg.getWidth(); int height = bitmapOrg.getHe ...

移动动画

移动动画:   http://bigcat.easymorse.com/?p=855    
卸载一个手机自带应用的更新的第三方包的时候,   BroadcastReceiver 接收到的是 /** 应用被替换 */ private static final String PACKAGE_REPLACED = "android.intent.action.PACKAGE_REPLACED";   不是 /** 安装新应用 */ private static final String PACKAGE_ADDED = "android.intent.action.PACKAGE_ADDED"; /** 卸载应用 */ private sta ...
/** 将一个图片由Drawable格式转化为 Bitmap格式 */   public static Bitmap drawableToBitmap(Drawable drawable) { Bitmap bitmap = Bitmap.createBitmap( drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_ ...
如何得到当前文件的大小呢:单位 B KB   M     String size = Formatter.formatFileSize(Demo.this,123424545); Log.d("test", "size"+ size );  
//已安装的应用信息 List<PackageInfo> packageInfos = getPackageManager() .getInstalledPackages(PackageManager.GET_UNINSTALLED_PACKAGES); //判断是否是第三方应用 boolean thirdApp = false ; if((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0){ thirdApp = true; }e ...
AlertDialog.Builder builder = new AlertDialog.Builder(context); if(icon != null){ builder.setIcon(icon); } if(!TextUtils.isEmpty(title)){ builder.setTitle(title); } if(!TextUtils.isEmpty(msg)){ builder.setMessage(msg); } if(!TextUtils.isEmpty(leftButton)){ builder ...
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); ListView listview = (ListView)this.findViewById(R.id.listview); String[] strs = new String[]{"2","0","1" ...
1、AlertDialog  捕获返回键的处理,使用setOnKeyListener事件可以。 2、AlertDialog  setView自定义的布局,去除上下左右的距离时使用的是: builder.setView(shareView, 0, 0, 0, 0), 并且还要用AlertDialog builder = new AlertDialog.Builder(ProductActivity.this).create();;   AlertDialog builder = new AlertDialog.Builder(ProductActivity.this).create(); ...

activity切换效果

activity strying  
Intent intent=new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_SUBJECT, "123456"); intent.putExtra(Intent.EXTRA_TEXT, "789789"); startActivity(Intent.createChooser(intent,getResources().getString(R.string.share_here) ));
android调用系统网络设置界面. 实例。
Global site tag (gtag.js) - Google Analytics