1、打開Eclipse,選擇File->new->Android Project,如附圖所示視窗:
2、選擇Create project from existing source單選框,然後點選->Browse..., 找到想要檢視的android例子目錄:
備注:一般android例子位于android的SDK安裝目錄中的samples下面的各個android版本目錄,例如:android-sdk-windows/samples/android-8
3、選擇好後,工程名和android開發版本都會自動選擇上,點選 finish,即可;
常見問題:
錯誤資訊:
[2011-04-22 16:26:16 - Home] ------------------------------
[2011-04-22 16:26:16 - Home] Android Launch!
[2011-04-22 16:26:16 - Home] adb is running normally.
[2011-04-22 16:26:16 - Home] No Launcher activity found!
[2011-04-22 16:26:16 - Home] The launch will only sync the application package on the device!
[2011-04-22 16:26:16 - Home] Performing sync
[2011-04-22 16:26:16 - Home] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'android1'
[2011-04-22 16:26:16 - Home] WARNING: Application does not specify an API level requirement!
[2011-04-22 16:26:16 - Home] Device API version is 8 (Android 2.2)
[2011-04-22 16:26:20 - Home] Application already deployed. No need to reinstall.
[2011-04-22 16:26:20 - Home] /Home/bin/Home.apk installed on device
[2011-04-22 16:26:20 - Home] Done!
[2011-04-22 16:29:01 - Home] ------------------------------
問題分析:根據紅色提示,說明沒有找到可運作的Activity
解決辦法:
打開AndroidManifest.xml清單檔案,找到" "位置,
将"”添加進去即可.
如下所示:
android:theme="@style/Theme"
android:launchMode="singleInstance"
android:stateNotNeeded="true">
原文出自CSDN http://blog.csdn.net/whwzm88/article/details/6342583