ボタンを使用してアクティビティを切り替えていますが、logcat によると、AndroidManifest.xml
少なくとも 5 回チェックした私のアクティビティでアクティビティを宣言しておらず、そこにあります。華氏クラスに切り替えようとしています。
ボタンのあるメインのJavaページは次のとおりです。
package com.jordandebarth.supercalculator;
import com.jordandebarth.supercalculator.distance;
import com.jordandebarth.supercalculator.exponents;
import com.jordandebarth.supercalculator.nuclearfusion;
import com.jordandebarth.supercalculator.pythagorean;
import com.jordandebarth.supercalculator.fahrenheittocelsius;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.support.v4.app.NavUtils;
public class tab_view extends Activity {
Button calculator, pythagorean, distance, exponent, temperature, nuclearfusion;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tab_view);
calculator = (Button)findViewById(R.id.calculatorButton);
pythagorean = (Button)findViewById(R.id.pythagoreanButton);
distance = (Button)findViewById(R.id.distanceButton);
exponent = (Button)findViewById(R.id.exponentsButton);
temperature = (Button)findViewById(R.id.temperatureButton);
nuclearfusion = (Button)findViewById(R.id.nuclearfusion);
pythagorean.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent pythagoreanIntent = new Intent(getBaseContext(), pythagorean.class);
startActivityForResult(pythagoreanIntent, 0);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
}
});
distance.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent distanceIntent = new Intent(getBaseContext(), distance.class);
startActivityForResult(distanceIntent, 0);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
}
});
exponent.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent exponentIntent = new Intent(getBaseContext(), exponents.class);
startActivityForResult(exponentIntent, 0);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
}
});
temperature.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent temperatureIntent = new Intent(getBaseContext(), fahrenheittocelsius.class);
startActivityForResult(temperatureIntent, 0);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
}
});
nuclearfusion.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
Intent nuclearfusionIntent = new Intent(getBaseContext(), nuclearfusion.class);
startActivityForResult(nuclearfusionIntent, 0);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
}
});
}
}
私の AndroidManifest は次のとおりです。
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jordandebarth.supercalculator"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".tab_view"
android:label="@string/title_activity_tab_view" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activty
android:name=".fahrenheittocelsius"
android:label="Fahrenheit to Celsius"
></activty>
<activity
android:name=".calculator"
android:label="Calculator" >
</activity>
<activity
android:name=".pythagorean"
android:label="Pythagorean Theorem"
>
</activity>
<activity
android:name=".distance"
android:label="Distance Formula"
></activity>
<activity
android:name=".exponents"
android:label="Exponents"
></activity>
<activity
android:name=".nuclearfusion"
android:label="Nuclear Fusion"
></activity>
</application>
</manifest>