【发布时间】:2014-07-03 21:48:21
【问题描述】:
我正在 Eclipse 中制作一个 android 应用程序,这是我在运行该应用程序时遇到的以下错误:
[2014-07-03 17:39:30 - LeapMotionApp] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.leapmotionapp/.MainActivity }
这是 MainActivity.java 代码:
package com.example.leapmotionapp;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import com.leapmotion.leap.*;
import com.leapmotion.leap.Gesture.State;
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
System.out.println("launched");
}
}
这里是activity_main.xml代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
</RelativeLayout>
仅提供一点背景知识,这是我第一次尝试制作 Android 应用程序,该应用程序旨在与 Leap Motion 传感器通信,当一切都说完后。如果您有任何问题,请告诉我,我们将不胜感激。
编辑: 现在收到这些错误:
[2014-07-03 18:05:02 - LeapMotionApp] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.leapmotionapp/.MainActivity }
[2014-07-03 18:05:02 - LeapMotionApp] ActivityManager: Warning: Activity not started, its current task has been brought to the front
这里也是清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.leapmotionapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
【问题讨论】:
-
发布整个堆栈跟踪。
-
它位于哪个视图下??