`
jianweicao
  • 浏览: 116910 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
  CharSequence text = editText.getText(); if (text instanceof Spannable) { Spannable spanText = (Spannable)text; Selection.setSelection(spanText, text.length()); }  
  android  "Keystore was tampered with, or password was incorrect"问题   debug.keystore 使用系统随机生成的,不要使用发布apk时候的私有keystore        
布局layout时, 发现设置了android:layout_gravity="bottom"后view并没有底对齐, 查了下, 原来如下: 对于 LinearLayout当 android:orientation="vertical"  时, 只有水平方向的设置才起作用,垂直方向的设置不起作用。即:left,right,center_horizontal 是生效的。当 android:orientation="horizontal" 时, 只有垂直方向的设置才起作用,水平方向的设置不起作用。即:top,bottom,center_ ...
  写道 public void shareText(Context context, String title, String text) { Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); intent.putExtra(Intent.EXTRA_SUBJECT, title); intent.putExtra(Intent.EXTRA_TEXT, text); context.startActivity(Intent.createChooser(intent ...
  android 加载网络图片的时候log打印 SkImageDecoder::Factory returned null,图片出不来。 查了一下,有人说是javanet 不如apache做得好,但是换成apache的httpclient 也会有这个问题。后来发现是http返回的状态码是错的,也就是用根本就访问不到。做http请求时候一般都会对返回结果进行判断,查看状态码是否正确,这次偏偏为了省事儿给忘了。 apache 代码如下: 写道 HttpGet httpRequest = new HttpGet(url);HttpClient httpclient = new Defa ...
  String  time  = "Fri Aug 02 15:29:39 +0800 2013"; SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.ENGLISH); Date date = sdf.parse(time);
转自http://blog.csdn.net/zouxueping/article/details/7003513       在android调试时,一旦将android的源码attach上,以后程序稍有改动,就会发现每次编译前有很长时间的Refreshing external folders,让人不厌其烦。我找了很久才发现detach的位置, ...
比如有ActivityA, ActivityB,在ActivityB中关闭ActivityA 解决方案: 1.在 ActivityA 里面设置一个静态的变量instance,初始化为this在 ActivityB 里面, ActivityA.instance.finish();   2. 也可以通过ActivityManager  ActivityManager manager = (ActivityManager)getSystemService(ACTIVITY_SERVICE);    manager.restartPackage(packageName);  ...
本文 2011-05-27 09:41 发表于本人CSDN 博客 http://blog.csdn.net/lonkiss/article/details/6449284现迁移至博客园 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 本文原创 转载请注明出处   在做项目是遇到这个错误 google : WindowManager: Activity  has leaked window 在stackoverflow.com(链接http://stackoverflow.com/quest ...
public void clearFeedTable(){ String sql = "DELETE FROM " + FEED_TABLE_NAME +";"; SQLiteDatabase db = dbHelper.getSQLiteDatabase(); db.execSQL(sql); revertSeq(); dbHelper.free(); } private void revertSeq() { String sql = "update sqlite_sequence ...
在ListView分页中,当刷下一页的数据时,会出现java.lang.ClassCastException: android.widget.HeaderViewListAdapter 不能强转为listview的异常信息,这是因为当向listview中加入headerview或者footviwer时,调用ListView的setAdapter方法会将adapter转化为headerviewlistadapter。   解决方法: HeaderViewListAdapter listAdapter = (HeaderViewListAdapter) listView.getA ...
<activity             android:windowSoftInputMode="stateHidden|adjustResize"             /> 布局中使用滚动条scrollview 控制滑动范围,例如标题下方
<TextView android:id="@+id/app_loc"  android:layout_width="wrap_content" android:layout_height="wrap_content"  android:textColor="#000000"  android:textSize="12dp" android:layout_marginLeft="10dip" android:singl ...
     Window window = dialogprogress.getWindow();WindowManager.LayoutParams lp = window.getAttributes();           lp.dimAmount =0f; window.setAttributes(lp);   
android:paddingLeft与android:layout_marginLeft 当按钮分别设置以上两个属性时,得到的效果是不一样的。 android:paddingLeft="30px" 按钮上设置的内容(例如图片)离按钮左边边界30个像素 android:layout_marginLeft="30px" 整个按钮离左边设置的内容30个像素
Global site tag (gtag.js) - Google Analytics