锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
<activity android:windowSoftInputMode="adjustResize" . . . >
褰撶偣鍑籈ditText鎺т歡寮瑰嚭杞敭鐩樼殑鏃跺欙紝緋葷粺浼氳嚜鍔ㄨ皟鏁存帶浠剁殑浣嶇疆銆?/p>
浠g爜
http://github.com/shaobin0604/miscandroidapps/tree/master/WindowSoftInputMode/
鍙傝?/p>
鐩墠閬囧埌鐨勯棶棰樻槸錛?/p>
鍦↙auncher閲屽彲浠ラ鍏堥厤緗闈㈡樉紺虹殑AppWidget錛屽鏋淎ppWidget鏈塁onfigure Activity錛屽垯緋葷粺鍦ˋppWidget鐨勫垵濮嬪寲榪囩▼涓嶄細鍙戦乤ndroid.appwidget.action.APPWIDGET_CONFIGURE Intent錛岃屽彧鏄姞杞絘ppwidget-provider閲岄厤緗殑initialLayout銆傝繖鏍風浜岀灝變笉鍙敤錛屽彧鑳界敤絎竴縐嶆柟娉曘?/p>
synchronized void
setTextSize(WebSettings.TextSize t)
Set the text size of the page.
void
setSupportZoom(boolean support)
Set whether the WebView supports zoom
void
setInitialScale(int scaleInPercent)
Set the initial scale for the WebView.
boolean
zoomIn()
Perform zoom in in the webview
boolean
zoomOut()
Perform zoom out in the webview
void
setBuiltInZoomControls(boolean enabled)
Sets whether the zoom mechanism built into WebView is used.
synchronized void
setJavaScriptEnabled(boolean flag)
Tell the WebView to enable javascript execution.
public static boolean backupDatabase() {
File dbFile = new File(Environment.getDataDirectory() + "/data/" + PKG + "/databases/" + DB_NAME);
File exportDir = new File(Environment.getExternalStorageDirectory(), "pocket-voa");
if (!exportDir.exists()) {
exportDir.mkdirs();
}
File file = new File(exportDir, dbFile.getName());
try {
file.createNewFile();
copyFile(dbFile, file);
return true;
} catch (IOException e) {
Log.e(TAG, "[backupDatabase] error", e);
return false;
}
}
public static boolean restoreDatabase() {
File dbFile = new File(Environment.getDataDirectory() + "/data/" + PKG + "/databases/" + DatabaseHelper.DB_NAME);
File exportDbFile = new File(Environment.getExternalStorageDirectory() + "/pocket-voa/" + DatabaseHelper.DB_NAME);
if (!exportDbFile.exists())
return false;
try {
dbFile.createNewFile();
copyFile(exportDbFile, dbFile);
return true;
} catch (IOException e) {
Log.e(TAG, "[restoreDatabase] error", e);
return false;
}
}
private static void copyFile(File src, File dst) throws IOException {
FileChannel inChannel = new FileInputStream(src).getChannel();
FileChannel outChannel = new FileOutputStream(dst).getChannel();
try {
inChannel.transferTo(0, inChannel.size(), outChannel);
} finally {
if (inChannel != null)
inChannel.close();
if (outChannel != null)
outChannel.close();
}
}
鍙傝?/p>
There are certain events that Android does not want to start up new processes for, so the device does not get too slow from all sorts of stuff all having to run at once.
ACTION_SCREEN_ON
is one of those. See this previous question for light blue advice on that topic.
So, you need to ask yourself, "Self, do I really need to get control on those events?". The core Android team would like it if your answer was "no".
adb devices
鍑虹幇濡備笅鍐呭
??????????? no permissions
鍘熷洜鏄惎鍔╝db鐨勬椂鍊欓渶瑕佹湁root鏉冮檺銆傚鏋滀竴寮濮嬪繕璁板姞浜唖udo, 灝卞繀欏誨厛緇堟adb銆?/p>
$ adb kill-server
$ sudo adb start-server
$ adb devices
灝卞彲浠ョ湅鍒拌澶囦俊鎭簡銆?/p>
Ubuntu 9.10 64bit, sun-jdk-1.5錛堝洜闇瑕佺紪璇慉ndroid婧愪唬鐮侊級, Android SDK 2.1
draw9patch 涓嶈兘姝g‘鏄劇ず鍑虹獥鍙o紝娌℃湁鑿滃崟鏍?/p>
sun jdk 1.5 鐨凚UG
瀹夎 sun jdk 1.6
sudo apt-get install sun-java6-jdk
sudo update-alternatives 鈥揷onfig java