Android 如何在eclipse中为touch应用程序编写清单(XML)?
我正在eclipse“Singletouch示例”中编写一个应用程序。我指的是。我无法编写正确的XML代码。它可能显示“不幸(您的应用程序)已停止”。错误或代码错误 代码: XML:Android 如何在eclipse中为touch应用程序编写清单(XML)?,android,xml,eclipse,android-manifest,Android,Xml,Eclipse,Android Manifest,我正在eclipse“Singletouch示例”中编写一个应用程序。我指的是。我无法编写正确的XML代码。它可能显示“不幸(您的应用程序)已停止”。错误或代码错误 代码: XML: 您应该在清单中添加正确的活动和包。 改变 android:name=“.MainActivity” android:name=“.SingleTouchActivity”和 AndroidManifest.xml中的package(package=“com.example.helloworld”到package=“
您应该在清单中添加正确的活动和包。 改变
android:name=“.MainActivity”
android:name=“.SingleTouchActivity”
和
AndroidManifest.xml中的package(package=“com.example.helloworld”到package=“de.vogella.android.touch.single”)
您可以从中获得单键触摸的源代码
这是您正在使用的软件包和类吗?试试这个:-
试试这个xml文件
感谢您的回复。我尝试过,但仍然显示“不幸的是TouchProject已停止”。我认为这是因为不正确的xml代码?请帮助。这是您正在使用的包和类吗?感谢您的回复。我尝试过,但仍然显示“不幸的是TouchProject已停止”" . 我认为这是因为不正确的xml代码?请帮忙。我认为Android不提供任何多点触控视图。所以,如果你想制作这样的应用程序,那么你需要使用上面的视图类型。我希望它能帮助你。嘿,我仍然无法修复“不幸的是TouchProject已停止”错误。你认为代码中的错误在哪里?
package de.vogella.android.touch.single;
import android.app.Activity;
import android.os.Bundle;
public class SingleTouchActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new SingleTouchEventView(this, null));
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.helloworld"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:debuggable="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
<activity android:name="SingleTouchActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.vogella.android.multitouch.MultitouchView
android:layout_width="match_parent"
android:layout_height="match_parent"
/>