随笔分类 -  Android

[转]android uri用法 http://blog.csdn.net/cnjzy0106/article/details/6206998
摘要:以下是常用到的Intent的URI及其示例,包含了大部分应用中用到的共用Intent。 一、打开一个网页,类别是Intent.ACTION_VIEW Uri uri = Uri.parse(“http://blog.3gstdy.com/”); Intent intent = new Intent(Intent.ACTION_VIEW, uri); 二、打开地图并定位到一个点 Uri uri = Uri.parse(“geo:52.76,-79.0342″); Intent intent = new Intent(Intent.ACTION_VIEW, uri); 三、打开拨号界... 阅读全文
posted @ 2012-04-08 17:26 Lee_Alvin 阅读(219) 评论(0) 推荐(0)
android note3
摘要:SDCard 往SDCard存文件,必须判断手机是否安装有SDCard,并且可以进行读写,访问SDCard必须在AndroidMainfest.xml中加入访问权限<!--在SDCard中创建与删除文件权限--><uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/><!--往SDCard写数据权限--><uses-permission android:name="android.permission.WRITE_EXTER 阅读全文
posted @ 2012-04-03 13:24 Lee_Alvin 阅读(152) 评论(0) 推荐(0)
android note2
摘要:android:name属性值的前面加了一个点表示NewActivity时当前com.alvin.test下的类,如果类在应用的当前包下,可以省略点符号,如果在应用的子包下必须加点,如NewActivity类在com.alvin.test.user包下可以这样写:<activity android:name=".user.NewAcitivity" /> requestCode用于标识结果数据来自哪个Activity触发startActivityForResult(Intent intent, int resultCode); resultCode用于为结果数据 阅读全文
posted @ 2012-03-25 15:57 Lee_Alvin 阅读(333) 评论(0) 推荐(0)
Android UI 相关知识
摘要:android.content.res 资源类 int getColor(int id) 对应res/values/colors.xml Drawable getDrawable(int id) 对应res/drawable/ XmlResourceParser getLayout(int id) 对应res/layout/ String getString(int id) 和CharSequence getText(int id) 对应res/values/strings.xml InputStream openRawResource(int id) 对应res/raw/ ... 阅读全文
posted @ 2012-02-21 17:05 Lee_Alvin 阅读(134) 评论(0) 推荐(0)
android琐碎笔记
摘要:1.得到屏幕的screen dimensionsDisplay display = getWindowManager().getDefaultDisplay();int width = display.getWidth();int height = display.getHeight();2. 播放 gif图片在android@Override protected void onDraw(Canvas canvas) {canvas.drawColor(0xFFCCCCCC); Paint p = new Paint(); p.setAntiAlias(true); canvas.drawBi 阅读全文
posted @ 2012-02-16 10:53 Lee_Alvin 阅读(275) 评论(0) 推荐(0)
Android中关于分享的实现
摘要:Android 使用MMS彩信或者Gmail发送图片Intent i = new Intent(Intent.ACTION_SEND); i.putExtra(Intent.EXTRA_STREAM,imageUri);//这里必须是图片的uri i.setType("image/jpeg"); startActivity(Intent.createChooser(i,TITLE_TIP));//TITLE_TIP是弹出的选择程序处理的文字标题==================================================Android 使用短信或者Gm 阅读全文
posted @ 2012-02-13 16:50 Lee_Alvin 阅读(203) 评论(0) 推荐(0)
Android 错误之 android java.lang.ClassCastException android.app.Application (转载)
摘要:Android 错误之 android java.lang.ClassCastException android.app.Application 定义类 DemoApp , 结果 Activity 调用始终报类错郁闷呀! class DemoApp extends Application{ } 翻看N多页百度无果,哎谷歌偶看老外遇到过硬着头皮看发现android:name=".ApiDemoApp"少指定Application类名。 <application android:icon="@drawable/icon" android:label=& 阅读全文
posted @ 2012-02-13 16:12 Lee_Alvin 阅读(982) 评论(0) 推荐(0)
设置Activity的属性
摘要:设置Activity的属性,两种方式:1:在manifest文件中指定的activity增加属性android:theme = "@android:style/Theme.CustomDialog"2:在程序中增加语句setTheme(R.style.Theme_CustomDialog);在onCreate()事件中增加setTheme(),必须在setContentView()之前,否则指定的Style不能生效。http://developer.android.com/guide/topics/resources/available-resources.html#sty 阅读全文
posted @ 2012-02-13 15:37 Lee_Alvin 阅读(177) 评论(0) 推荐(0)
android adapter 操作Activity中的方法 ------------弱引用WeakReference----断点记录
摘要:--------------------------背景--------------------------------------------Activity中有个Popupwindow.想在Adapter中的getView中设置Checbox的点击事件时,就显示与隐藏这个Popupwindow但是因为Adapter与Activity不是同一个类,所以操作有点麻烦..--------------------------分割线--------------------------------------------类: Adapter 继承 BaseAdapter类:Activity 继承Act 阅读全文
posted @ 2012-02-13 15:13 Lee_Alvin 阅读(1218) 评论(0) 推荐(0)