私はAndroidプログラミングの新機能で、ボタンクリックでアプリが強制終了する理由を理解しようとしています。私はそれをいくつかに絞り込んだ。複数のアプリケーションタグを持つAndroidManifest.xml
1つの質問;マニフェストXMLに複数の<application>
タグを含めることは可能ですか?
は、ここに私のコードです:私が研究してきました
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dummies.android.beergoggles"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<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>
<activity android:name="Result" android:label="@string/app_name"> </activity>
</application>
<application android:name="MyApp"
android:icon="@drawable/icon"
android:label="@string/app_name2"></application>
が、新しいアプリケーションの新しいマニフェストファイルを作成する方法について漠然としかポストを見つけました。 MyAppアプリケーションは、新しいアプリケーションなしでそれを行う方法がないと思うので、 "グローバル変数"のためのアプリです。
import android.app.Application;
public class MyApp extends Application{
public static int resultCount;
public int getCount(){
return resultCount;
}
public void setCount(int c){
resultCount = c;
}
}
すべてのヘルプははるかに高く評価されるだろう:それは役立ちます場合にはここで
は、MyAppのためのコードです。
+1よく尋ねられます。良い情報を得るための十分な情報。 – Sepster