-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ragecolor.5884
committed
Dec 25, 2010
1 parent
2c2c9ce
commit ba296f5
Showing
17 changed files
with
200 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="src" path="gen"/> | ||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>ApplicationClassTest</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>com.android.ide.eclipse.adt.ApkBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.kobashin.applicationclasstest" android:versionCode="1" | ||
android:versionName="1.0"> | ||
<!-- application属性に「android:name」属性を追加 --> | ||
<application android:name="com.kobashin.applicationclasstest.TestApplication" | ||
android:icon="@drawable/icon" android:label="@string/app_name"> | ||
|
||
<activity android:name=".Main" 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=".Sub" android:label="@string/app_name"> | ||
</activity> | ||
|
||
</application> | ||
<uses-sdk android:minSdkVersion="8" /> | ||
|
||
</manifest> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This file is automatically generated by Android Tools. | ||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED! | ||
# | ||
# This file must be checked in Version Control Systems. | ||
# | ||
# To customize properties used by the Ant build system use, | ||
# "build.properties", and override values to adapt the script to your | ||
# project structure. | ||
|
||
# Project target. | ||
target=android-8 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:orientation="vertical" android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" android:id="@+id/Layout01"> | ||
<TextView android:layout_width="fill_parent" | ||
android:layout_height="wrap_content" android:text="@string/hello" /> | ||
|
||
<Button android:text="Call Sub Activity" android:id="@+id/Button01" | ||
android:layout_width="wrap_content" android:layout_height="wrap_content"></Button> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"><ImageView android:id="@+id/ImageView01" android:layout_width="wrap_content" android:layout_height="wrap_content"></ImageView> | ||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="hello">Hello World, Main!</string> | ||
<string name="app_name">ApplicationClassTest</string> | ||
</resources> |
47 changes: 47 additions & 0 deletions
47
ApplicationClassTest/src/com/kobashin/applicationclasstest/Main.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.kobashin.applicationclasstest; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.graphics.Bitmap; | ||
import android.graphics.BitmapFactory; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.view.View.OnClickListener; | ||
import android.widget.Button; | ||
import android.widget.TextView; | ||
|
||
public class Main extends Activity implements OnClickListener { | ||
private Bitmap bmp_main; | ||
private TestApplication ta; | ||
private Button bt; | ||
|
||
/** Called when the activity is first created. */ | ||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.main); | ||
|
||
/* getApplication()で自己アプリケーションクラスのインスタンスを拾う */ | ||
ta = (TestApplication) this.getApplication(); | ||
|
||
bt = (Button) findViewById(R.id.Button01); | ||
bt.setOnClickListener(this); | ||
|
||
} | ||
|
||
@Override | ||
public void onClick(View v) { | ||
if (v == bt) { | ||
bmp_main = BitmapFactory.decodeResource(getResources(), | ||
R.drawable.andy); | ||
|
||
ta.setObj(bmp_main); | ||
|
||
Intent i = new Intent(); | ||
i.setClassName("com.kobashin.applicationclasstest", | ||
"com.kobashin.applicationclasstest.Sub"); | ||
startActivity(i); | ||
} | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
ApplicationClassTest/src/com/kobashin/applicationclasstest/Sub.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.kobashin.applicationclasstest; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.graphics.Bitmap; | ||
import android.graphics.BitmapFactory; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
import android.widget.ImageView; | ||
import android.widget.LinearLayout; | ||
import android.widget.TextView; | ||
|
||
public class Sub extends Activity { | ||
|
||
/** Called when the activity is first created. */ | ||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.sub); | ||
|
||
TextView tView = new TextView(this); | ||
|
||
/* getApplication()で自己アプリケーションクラスのインスタンスを拾う */ | ||
TestApplication ta = (TestApplication)this.getApplication(); | ||
|
||
Bitmap bmp_sub = ta.getObj(); | ||
|
||
LinearLayout lLayout = (LinearLayout)findViewById(R.id.LinearLayout01); | ||
ImageView iView = (ImageView)findViewById(R.id.ImageView01); | ||
|
||
iView.setImageBitmap(bmp_sub); | ||
|
||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
ApplicationClassTest/src/com/kobashin/applicationclasstest/TestApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.kobashin.applicationclasstest; | ||
|
||
import android.app.Application; | ||
import android.graphics.Bitmap; | ||
import android.util.Log; | ||
|
||
public class TestApplication extends Application { | ||
private final String TAG = "DEBUG-APPLICATION"; | ||
private Bitmap obj; | ||
|
||
@Override | ||
public void onCreate() { | ||
/** Called when the Application-class is first created. */ | ||
Log.v(TAG,"--- onCreate() in ---"); | ||
} | ||
|
||
@Override | ||
public void onTerminate() { | ||
/** This Method Called when this Application finished. */ | ||
Log.v(TAG,"--- onTerminate() in ---"); | ||
} | ||
|
||
public void setObj(Bitmap bmp){ | ||
obj = bmp; | ||
} | ||
|
||
public Bitmap getObj(){ | ||
return obj; | ||
} | ||
} |