摘要:
Most of the time you need to create a Service to perform something in the background, and your visible Activity simply controls this Service. (I'm sure the Music player works in the same way, so the example in the docs seems a bit misleading.) If that's the case, then your Activity can finis 阅读全文
摘要:
public static Bitmap decodeSampledBitmapFromResource(Resources res, int resId, int reqWidth, int reqHeight) { // First decode with inJustDecodeBounds=true to check dimensions final BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; Bitm... 阅读全文
摘要:
http://guibin.iteye.com/blog/1014369 阅读全文
摘要:
首次获取代码1.sign-in gerrit (only for the very first time) Command of adding new generated ssh key: ssh-add ~/.ssh/id_rsa2.Modify the user.name of git. Command: git config --global user.name <your_ldap_account>3.repo init -u ssh://<your_ldap_account>@216.224.176.142:29418/gmpoc/manifest -m gm 阅读全文
摘要:
重新生成的key加入:ssh-add ~/.ssh/id_rsa 阅读全文
摘要:
当前的activity切换到后台,切换语言,回到原来的activity,原来的activity不见,出现又一新activity。原因:没有在AndroidManifest.xml 中申明android:configChangesandroid:configChangesLists configuration changes that the activity will handle itself. When a configuration change occurs at runtime, the activity is shut down and restarted by default, 阅读全文
摘要:
1.方法一View Code private void initScrollBar() { try { Field f = AbsListView.class.getDeclaredField("mFastScroller"); f.setAccessible(true); Object o = f.get(mListView); f = f.getType().getDeclaredField("mThumbDrawable"); f.setAccessible... 阅读全文
摘要:
当eclipse装了MAT, 可以直接打开hprof, 当有时会遇到Unknown HPROF Version (JAVA PROFILE 1.0.3)解决方法:使用AndrodiSDK/tools/hprof-conv转化hprof文件, 例如 hprof-conv input.hprof out.hprof 阅读全文
摘要:
<TextView android:layout_width="100px" android:layout_height="wrap_content" android:ellipsize="marquee" android:focusable="true" android:focusableInTouchMode="true" android:marqueeRepeatLimit="marquee_forever" android:scrollHorizontally= 阅读全文
摘要:
private OnItemClickListener listener = new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { } };mListView.setOnItemClickListener(listener);原因是ListView中有ImageButton,把ImageButton改为ImageView,ImageView 不会把事件发... 阅读全文