【发布时间】:2013-09-06 00:18:56
【问题描述】:
我按照基本 Phonegap 教程(Eclipse、Android SDK、ADT Phonegap)中的所有步骤,创建了一个 index.html 页面(来自 phonegap 站点的代码)和 assets/www 文件夹中的 cordova-2.2.0.js 和 cordova-2.2.0.jar ,当我运行它时,它在控制台屏幕上显示了这条消息:
[2013-09-05 12:44:14 - phonegape-test] ------------------------------
[2013-09-05 12:44:14 - phonegape-test] Android Launch!
[2013-09-05 12:44:14 - phonegape-test] adb is running normally.
[2013-09-05 12:44:14 - phonegape-test] No Launcher activity found!
[2013-09-05 12:44:14 - phonegape-test] The launch will only sync the application package on the device!
[2013-09-05 12:44:14 - phonegape-test] Performing sync
[2013-09-05 12:44:14 - phonegape-test] Automatic Target Mode: launching new emulator with compatible AVD 'STest'
[2013-09-05 12:44:14 - phonegape-test] Launching a new emulator with Virtual Device 'STest'
[2013-09-05 12:44:27 - phonegape-test] New emulator found: emulator-5554
[2013-09-05 12:44:27 - phonegape-test] Waiting for HOME ('android.process.acore') to be launched...
[2013-09-05 12:46:25 - phonegape-test] HOME is up on device 'emulator-5554'
[2013-09-05 12:46:25 - phonegape-test] Uploading phonegape-test.apk onto device 'emulator-5554'
[2013-09-05 12:46:26 - phonegape-test] Installing phonegape-test.apk...
[2013-09-05 12:47:35 - phonegape-test] Success!
[2013-09-05 12:47:35 - phonegape-test] \phonegape-test\bin\phonegape-test.apk installed on device
[2013-09-05 12:47:35 - phonegape-test] Done!
但该应用程序不起作用,我没有找到我的应用程序 lancher 图标!你能帮帮我吗!
编辑: MainActivity.java:
package com.example.phonegape;
import android.os.Bundle;
import android.view.Menu;
import org.apache.cordova.*;
//import com.phonegap.DroidGap;
public class MainActivity extends DroidGap {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.init();
super.loadUrl("file:///assets/www/index.html");
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
【问题讨论】:
-
“不起作用”是什么意思?有没有黑屏之类的?应用坏了?请说明。
-
没有黑屏,也没有应用中断!模拟器启动了,什么也没发生
-
您可以发布您的活动吗? (我猜你只有一个,对吧?)
-
是的,我只有一个。看看 myMainActicity.java 我在我的问题中添加了它!