嘿,我得到了启动:我的控制台中的意图线 现在有一个新的界限:
[2011-02-03 15:00:34 - Versuch] ActivityManager: [1] Killed am start -n vers...
我想我杀了一些东西,但是我杀了什么以及如何杀死?
我的清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="versuch.datenbank"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".projectshome"
android:label= "@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.action.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".projects"/>
<activity android:name=".Projects_New"/>
</application>
</manifest>
主要活动,首先开始的活动......
public class projectshome extends Activity {
SQLiteDatabase myDB = null;
final static String MY_DB_NAME = "Projects-Database";
final static String MY_DB_TABLE = "projects";
static final int MENU_PROJECTS = 1;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
onCreateDBAndDBTabled(); //DB und Tables erstellen wenn noch nicht vorhanden
setContentView(R.layout.main);
}
private void onCreateDBAndDBTabled() {
myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);
myDB.execSQL("CREATE TABLE IF NOT EXISTS " + MY_DB_TABLE
+ " (_id integer primary key autoincrement,"+
"Name varchar(100),"+
"Comment varchar(128),"+
"BookingDetails varchar(255),"+
"CustomerProject integer(3),"+
"editable integer(3))"
+";");
}
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
menu.add(0, MENU_PROJECTS, 0, R.string.menuProjects)
.setShortcut('1', 'f')
.setIcon(R.drawable.icon);
return true;
}
public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case MENU_PROJECTS:
Intent iProjects = new Intent(this, projects.class);
startActivity(iProjects);
return true;
}
return false;
}
}
答案 0 :(得分:0)
令我感到奇怪的一件事是,你的班级名字以小写字母开头,所以你应该在任何情况下改变这一点:
public class Projectshome extends Activity {