我正在制作一个简单的教程 android 应用程序,我想将它与我拥有的 android 游戏应用程序结合起来,我希望主应用程序是 android 应用程序教程,然后游戏应用程序是子菜单或在我的应用程序中,你能告诉我吗如何结合它
(一些代码让您对我的代码有所了解)
HomeActivity.Java:(我的教程)
package com.wglxy.example.dash1;
import android.os.Bundle;
public class HomeActivity extends DashboardActivity
{
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
}
protected void onDestroy ()
{
super.onDestroy ();
}
protected void onPause ()
{
super.onPause ();
}
protected void onRestart ()
{
super.onRestart ();
}
protected void onResume ()
{
super.onResume ();
}
protected void onStart ()
{
super.onStart ();
}
protected void onStop ()
{
super.onStop ();
}
} // end class
ChuchApplication.java(游戏应用):
/**
*
*/
package com.wglxy.example.dash1;
//import com.tmm.android.chuck.quiz.GamePlay;
import android.app.Application;
/**
* @author rob
*
*/
public class ChuckApplication extends Application{
private GamePlay currentGame;
/**
* @param currentGame the currentGame to set
*/
public void setCurrentGame(GamePlay currentGame) {
this.currentGame = currentGame;
}
/**
* @return the currentGame
*/
public GamePlay getCurrentGame() {
return currentGame;
}
}
这是我的androidmanifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.wglxy.example.dash1"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:icon="@drawable/sajda"
android:label="@string/app_name"
android:theme="@style/Theme.D1" >
<activity
android:name=".HomeActivity"
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=".F1Activity"
android:label="@string/title_feature1"
android:theme="@style/Theme.D1" />
<!--
activity
android:name=".F2Activity"
android:label="@string/title_feature2"
android:theme="@style/Theme.D1" />
-->
<activity
android:name=".F3Activity"
android:label="@string/title_feature3"
android:theme="@style/Theme.D1" />
<activity
android:name=".F4Activity"
android:label="@string/title_feature4"
android:theme="@style/Theme.D1" />
<activity
android:name=".BasicTutorial"
android:label="@string/title_feature5"
android:theme="@style/Theme.D1" />
<activity
android:name=".BasicTutorial2"
android:label="@string/title_feature5"
android:theme="@style/Theme.D1" />
<activity
android:name=".BasicTutorial3"
android:label="@string/title_feature5"
android:theme="@style/Theme.D1" />
<activity
android:name=".BasicTutorial4"
android:label="@string/title_feature5"
android:theme="@style/Theme.D1" />
<activity
android:name=".BasicTutorial5"
android:label="@string/title_feature5"
android:theme="@style/Theme.D1" />
<activity
android:name=".BasicTutorial6"
android:label="@string/title_feature5"
android:theme="@style/Theme.D1" />
<!-- activity
android:name=".SingleListItem"
android:label="Single Item Selected" >
</activity>-->
<service
android:name=".ChuckApplication"
android:theme="@style/Theme.D1" />
<activity
android:name=".SplashActivity"
android:label="@string/app_name"
android:theme="@style/Theme.D1" />
<activity
android:name=".QuestionActivity"
android:theme="@style/Theme.D1" />
<activity
android:name=".RulesActivity"
android:theme="@style/Theme.D1" />
<activity
android:name=".EndgameActivity"
android:theme="@style/Theme.D1" />
<activity
android:name=".SettingsActivity"
android:theme="@style/Theme.D1" />
<activity
android:name=".AnswersActivity"
android:theme="@style/Theme.D1" />
</application>
</manifest>
谁能帮我做什么?任何困惑请评论我,我会尽力帮助你。