- 博客(11)
- 资源 (9)
- 收藏
- 关注
原创 在使用drawBitmap()将绘制的图片全屏显示
有时候我们这使用canvas.drawBitmap()时,需要使图片全屏显示,这个时候我们可以这样: DisplayMetrics ds = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(ds); int w = ds.widthPi
2014-11-29 16:12:49
2541
原创 Java获取随机数的方法
方法1 (数据类型)(最小值+Math.random()*(最大值-最小值+1)) 例: (int)(1+Math.random()*(10-1+1)) 从1到10的int型随数 方法2 获得随机数 for (int i=0;i {System.out.println((int)(1+Math.random()*10));} (int)(1+Math.random()*10)
2014-11-02 01:05:23
660
原创 imagebutton按下效果(不用selector)
通常情况下,我们可以采用如下方式实现: ; ; ; ; ; ; ; 把这个文件放在drawable目录下面。命名为button_add_x.xml 使用的时候: android:id=";@+id/ImageButt
2014-10-25 16:52:05
568
原创 fragment之间的参数传递
使用Fragment的时候可能需要在两个Fragment之间进行参数的传递,找到一个方法就能实现像Activity一样便捷的实现参数传递 程序中的一段代码 [java] view plaincopy ft.hide(getActivity().getSupportFragmentManager().findFragmentByTag(“”));
2014-10-24 23:49:21
464
原创 在使用Intent跳转时最容易犯的错误
1.manifest 忘记写activity; 2.button 的id 写混; 3.onRestartButtonClick() 拼写错误;
2014-10-11 10:51:18
674
原创 How to solve Exception raised during rendering: java.lang.System.arraycopy([CI[CII)V in Android
So today, while writing an example for the JCG community, I came across the following exception, while trying to add an EditText element to my application: Exception raised during rendering: java.l
2014-10-11 10:29:26
2701
原创 在Android Studio中添加assets目录
在Android Studio中添加assets目录,目录的位置在 XXX\src\main\assets XXX代表你的项目的路径,assets放在src\main目录下。
2014-10-11 08:50:39
718
原创 android surfaceview 双线程实现计时的同时 可以随意移动滑块
import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PorterDuff;
2014-10-06 01:16:46
609
原创 Eclipse 中 显示代码的行号
如何在 Eclipse 中显示代码的行号第一种方法:Ctrl+F10,打开视图菜单,选择show line numbers 就OK了第二种方法: windows->Preferences->General->Editors->Text ...
2014-10-04 21:30:57
487
原创 如何解决Android 导入项目时 Invalid project description 问题
刚开始 如何解决Android+eclipse环境打开已有工程,遇到Invalid project description 问题 搭建好了环境,把之前的工程搬到了新的环境下,结果怎么打开都遇到Invalid project description的错误提示。 把工程不能直接放置在设定的Workspace目录下。换一个目录或者套一个目录就OK了。
2014-10-04 20:30:04
436
Linux系统分析
2014-11-11
Fragment之间的多种切换效果
2014-11-29
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅