摘要: 区别:AFragmentActivityis a subclass ofActivitythat was built for theAndroid Support Package.TheFragmentActivityclass adds a couple new methods to ensure compatibility with older versions of Android, but other than that, there really isn't much of a difference between the two. Just make sure you ch 阅读全文
posted @ 2014-04-09 09:53 thirsty coder 阅读(293) 评论(0) 推荐(0) 编辑
摘要: public class MyApplication extends Application { public int getColorCount() { return 1; }}public class TestFragment extends Fragment { @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); int test = ((MyApp... 阅读全文
posted @ 2014-04-08 23:36 thirsty coder 阅读(470) 评论(0) 推荐(0) 编辑
摘要: //得到view在父容器中的位置下标 int index=((ViewGroup)v.getParent()).indexOfChild(v); 阅读全文
posted @ 2014-04-06 14:28 thirsty coder 阅读(480) 评论(0) 推荐(0) 编辑
摘要: 1) go toRun > Run Configurations... > (Select your application on the left hand side) > (Click the"Target"tab on the right hand side). 2) At the bottom there, you'll see'Emulator launch parameters'. In the'additional emulator command line options', add'-sca 阅读全文
posted @ 2014-04-06 13:12 thirsty coder 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 你确认是一个eclipse写的web项目包?是的话,你这个操作结束的时候,应该有个可以看见的项目名给你勾选的,那样才能finish。假如不是enlipse开发的,是其它IDE开发的,或者不完整,他和ec的项目结构有些区别,认不出来的。你可以这样导入看:自己new一个新的web项目。把已有的项目的src目录copy到你new的项目的src那里,同理把web也copy进去new的那里。再刷新编译启动这个new的,应该就没问题了。我经常用这个方法导入网上下载的一项项目包来研究另外,运行在server要 阅读全文
posted @ 2014-04-04 21:46 thirsty coder 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 新建workspace时勾选那两个coopy选项直接Copy目录{旧workspace}\.metadata\.plugins\org.eclipse.core.runtime\.settings下所有文件去{新workspace}的同名目录里。 阅读全文
posted @ 2014-04-04 11:47 thirsty coder 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 由于对网上流传的横竖屏切换生命周期文章的质疑,自己分别在android模拟器(Android4.3)和真机(小米m1,android4.0)进行测试,测试结果如下:程序运行:onCreate()->onStart()->onResume()按home键:onPause()->onSaveInstanceState()->onStop()然后点程序图标进入触发:onRestart()->onStrart()->onResume()按返回键:onPause()->onStop()->onDestroy()然后点程序图标进入触发:onCreate()- 阅读全文
posted @ 2014-04-03 16:06 thirsty coder 阅读(1543) 评论(0) 推荐(0) 编辑
摘要: 代码设置ImageView的src:setImageDrawable(Drawable drawable);setImageBitmap(Bitmap bm);setImageResource(int resId);代码设置ImageView的background: setBackgroundReource(int resid)setBackground(Drawable background)setBackgroundColor(int color)setBackgroundDrawable(Drawable background) //This method was deprecated 阅读全文
posted @ 2014-03-21 15:27 thirsty coder 阅读(948) 评论(0) 推荐(0) 编辑