`
bashenmail
  • 浏览: 228764 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
以下代码在pc上测试通过,可是在android模拟器上就不工作,不过还可以链接到服务器但不能得到文件 纠结了半天,原来是模式的问题,具体请Google 模拟器中采用建议被动模式   public void doWork(){ FTPClient ftp = new FTPClient(); try { ftp.connect(server); System.out.println("Connected to " + server); System.out.print(ftp.getReplySt ...

关闭键盘显示

两种方法: 法一: InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.SHOW_IMPLICIT, InputMethodManager.HIDE_NOT_ALWAYS);  法二: InputMethodManager imm = (InputMethodManager) getSystemSe ...
文章来自:http://zzmccnu.iteye.com/blog/457297 收藏一下   使用Git下载Google Android源代码 准备资源 Android资源分布说明:http://source.android.com/projects#TOC-External-projects Android的Git资源:http://android.git.kernel.org/ Git中文教程:http://www.bitsun.com/documents/gittutorcn.htm Git下载地址:http://code.google.com/p/msysgit/     
具体看代码:   public class CityAdapter<T> extends BaseAdapter implements Filterable { /** * Contains the list of objects that represent the data of this ArrayAdapter. * The content of this list is referred to as "the array" in the documentation. */ private List& ...
转自:http://blog.csdn.net/wukunting/archive/2010/01/24/5251302.aspx   每次我们锁键盘的时候,都看到如下页面:        看多了就产生审美疲劳, 手机是追求个性化的消费品,想到就是替换她,再找一个。        如何替换呢?Android ...
 代码如下: SearchDialog.java import android.app.Dialog; import android.content.Context; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.ImageButton; ...
<TextView android:id="@+id/app_shortcontent" android:layout_width="wrap_content" android:layout_height="wrap_content" android:singleLine="true" android:textColor="#FFFFFFFF" android:scrollHorizontally ...
对象必须实现Serializable,对象代码如下: import java.io.Serializable; import android.graphics.drawable.Drawable; //传送的对象 public class MyApplicationInfo extends Object implements Serializable{ //Your code }   自定义:AppParcelable import android.os.Parcel; import android.os.Parcelable; im ...
Uri packageURI = Uri.parse("package:"+packageName); Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI); startActivityForResult(uninstallIntent,ISUNINSTALL);  ISUNINSTALL为一个整形数值这里回调onActivityResult,如果不需要回调可以直接调用startActivity(uninstallIntent ...
Intent i = new Intent("android.intent.action.MAIN"); i.setComponent(new ComponentName(packageName, className)); startActivity(i);  packageName包名 className类名
Intent installIntent = new Intent("android.intent.action.VIEW"); installIntent.setData(Uri.parse("market://search?q=pname:"+packageName)); startActivity(installIntent);  其中packageName为软件包名 Uri可以为(包名):http://market.android.com/search?q=pname:<pack ...

RGB转成ARGB

colors.xml <?xml version="1.0" encoding="utf-8"?> <resources> <color name="solid_blue">#0000ff</color> </resources>  转换代码: int color = getResources().getColor(R.color.solid_blue);  color就是个ARGB的颜色
代码如下: import android.content.Context; import android.preference.Preference; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.RatingBar; import android.widget.TextView; import com.tcad.marketassistant.R; public class Commen ...
<ListView android:id="@id/android:list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:drawSelectorOnTop="true" android:listSelector="@drawable/selector" android:divid ...
import android.content.Context; import android.database.Cursor; import android.provider.MediaStore; import android.view.View; import android.widget.SimpleCursorAdapter; import android.widget.TextView; public class MusicListAdapter extends SimpleCursorAdapter { private static boolean[] isF ...
Global site tag (gtag.js) - Google Analytics