摘要:
打开终端,输入:killall ibus-daemon(结束进程)ibus-daemon -d(重启ibus) 阅读全文
摘要:
public class Test extends Activity implements OnClickListener { private EditText etName; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); etName = (EditText) findViewById(R.id.etName); ... 阅读全文
摘要:
public class CreateFile extends Activity { private BufferedReader reader; private TextView tvFileReader; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.lay... 阅读全文
摘要:
如果是Activity的话在 Manifest.xml 相应的 Activity 里添加android:windowSoftInputMode="adjustPan|stateHidden"如果是其他View的话添加以下代码InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0); // view是需要控制的view对象 阅读全文
摘要:
layout/imageswitch.xml<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageSwitcher android:id=& 阅读全文
摘要:
参考Android拍照、录像、录音代码范例public class MyCameraActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button btnCamera = (But... 阅读全文
摘要:
详情参考 某android平板项目开发笔记---计划任务备份新建一个类继承 AsyncTaskpublic class BackupTask extends AsyncTask<String, Void, Integer> { private static final String COMMAND_BACKUP = "backupDatabase"; public static final String COMMAND_RESTORE = "restroeDatabase"; private Context mContext; public 阅读全文
摘要:
// 新建一个toast对象private Toast toast; public void showMsg(String arg) { if (toast == null) { toast = Toast.makeText(this, arg, Toast.LENGTH_SHORT); } else { toast.cancel(); toast.setText(arg); } toast.show(); }res/drawable目录下面建立一个设置圆角边框... 阅读全文
摘要:
第一步: 创建表CREATE TABLE DLION ( _id INTEGER PRIMARY KEY AUTOINCREMENT, content TEXT, questionId INTEGER, answerId INTEGER, [right] INTEGER );第二步: 把编辑文本内容并放到 res/raw/test.txt 用Notepad++ 打开,把每一个将要放在表中单元格的内容放一行(注:^ 代表行首$ 代表行尾) 去除行尾空格和空白行:按CTRL+H 选择正则表达式-- 查找目标:\s+$ 替换为空 ... 阅读全文
摘要:
import java.util.ArrayList;import java.util.List;import java.util.Random;public class H { public static void main(String args[]) { int N = 10; List<Integer> list = new ArrayList<Integer>(); for (int i = 0; i < N; i++) { list.add(i + 1); } int count = ... 阅读全文