我目前正忙于为我的主要项目设计一个自定义视图。我浏览了developer.android.com提供的自定义视图教程。我下载了相关的可共享项目,因为当源代码摆在您面前时,它会变得很容易处理和理解应用程序的机制。令我惊讶的是,该项目只包含src和res两个文件夹,并且没有android-manifest文件。我尝试了普通的导入方法,从现有的代码导入,并从现有的android代码创建新的项目,没有任何方法的幸运。这里是project.的链接
有人能给我解释一下怎样才能让它工作吗?
发布于 2013-03-25 00:26:44
创建一个新的空android项目。将所有资源和源文件复制到项目文件夹中。
http://developer.android.com/guide/topics/manifest/manifest-intro.html。
Goto AndroidManifest.xml相应地定义活动和权限。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="package name"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="packagename.MainActivity"//your 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>
<activity
android:name="packagename.SecondActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="packagename.SecondActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
发布于 2013-03-25 00:24:41
,有人能给我解释一下怎样才能让它工作吗?
创建一个空的Android项目。从ZIP文件中复制res/和src/。修改清单以指向您从ZIP文件复制的活动类。
https://stackoverflow.com/questions/15600915
复制相似问题