package com.suit;
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;
import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.SeekBar;import android.widget.EditText;import android.widget.SeekBar.OnSeekBarChangeListener;
public class bodysize extends Activity implements SeekBar.OnSeekBarChangeListener{
SeekBar mSeekBar; EditText text1; EditText text2; EditText TrackingText; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.bodysize); mSeekBar = (SeekBar)findViewById(R.id.seekBar1); mSeekBar.setOnSeekBarChangeListener(this); text1 = (EditText)findViewById(R.id.editText1); TrackingText =(EditText)findViewById(R.id.editText1); mSeekBar = (SeekBar)findViewById(R.id.seekBar2); mSeekBar.setOnSeekBarChangeListener(this); text2 = (EditText)findViewById(R.id.editText2); TrackingText =(EditText)findViewById(R.id.editText2); Button basic_button1 = (Button) findViewById(R.id.button1); basic_button1.setOnClickListener(new View.OnClickListener() { //public void onClick(View v) { //Toast.makeText(testview.this, "ImageButton02 clicked", Toast.LENGTH_SHORT).show(); //startActivity(new Intent(getApplicationContext(), bodysizetext.class)); public void main(String[] args) throws IOException{ BufferedReader in =new BufferedReader (new InputStreamReader(System.in)); int iVariable = 0, iRetValue = 0; //int a, b, c, d, e, f, g, h, i; //System.out.println("키를 입력하시오"); iVariable = R.id.editText1; //Integer.parseInt(in.readLine()); //System.out.println("몸무게를 입력하시오"); iRetValue = R.id.editText2; //키작고 마른 체형 if(iVariable >= 160 && iVariable <= 164 && iRetValue >= 64) { System.out.println(bodysizetext.class); //return a; //startActivity(new Intent(getApplicationContext(), bodysizetext.class)); } else if (iVariable >= 165 && iVariable <= 169 && iRetValue >= 68) { startActivity(new Intent(getApplicationContext(), bodysizetext.class)); } else if(iVariable >= 170 && iVariable <= 173 && iRetValue >= 72) { startActivity(new Intent(getApplicationContext(), bodysizetext.class)); } // if(iVariable >= 160 && iVariable <= 164 && iRetValue >= 54 && iRetValue <= 63) { startActivity(new Intent(getApplicationContext(), bodysizetext1.class)); } else if(iVariable >= 165 && iVariable <= 169 && iRetValue >= 58 && iRetValue <= 67) { startActivity(new Intent(getApplicationContext(), bodysizetext1.class)); } else if(iVariable >= 170 && iVariable <= 173 && iRetValue >= 62 && iRetValue <= 71) { startActivity(new Intent(getApplicationContext(), bodysizetext1.class)); } // if(iVariable >= 160 && iVariable <= 164 && iRetValue <= 53) { System.out.println("c"); } else if(iVariable >= 165 && iVariable <= 169 && iRetValue <= 57) { System.out.println("c"); } else if(iVariable >= 170 && iVariable <= 173 && iRetValue <= 61) { System.out.println("c"); } // if(iVariable >= 174 && iVariable <= 178 && iRetValue >= 77) { System.out.println("d"); } else if(iVariable >= 174 && iVariable <= 178 && iRetValue >= 68 && iRetValue <= 76) { System.out.println("e"); } else if(iVariable >= 174 && iVariable <= 178 && iRetValue <= 67) { System.out.println("f"); } // if(iVariable >= 179 && iVariable <= 183 && iRetValue >= 84) { System.out.println("g"); } else if(iVariable >= 184 && iVariable <= 188 && iRetValue >= 88) { System.out.println("g"); } else if(iVariable >= 189 && iVariable <= 193 && iRetValue >= 92) { System.out.println("g"); } else if(iVariable >= 194 && iVariable <= 198 && iRetValue >= 96) { System.out.println("g"); } // if(iVariable >= 179 && iVariable <= 183 && iRetValue >= 73 && iRetValue <= 83) { System.out.println("h"); } else if(iVariable >= 184 && iVariable <= 188 && iRetValue >= 77 && iRetValue <= 87) { System.out.println("h"); } else if(iVariable >= 189 && iVariable <= 193 && iRetValue >= 81 && iRetValue <= 91) { System.out.println("h"); } else if(iVariable >= 194 && iVariable <= 198 && iRetValue >= 85 && iRetValue <= 95) { System.out.println("h"); } // if(iVariable >= 179 && iVariable <= 183 && iRetValue <= 72) { System.out.println("i"); } else if(iVariable >= 184 && iVariable <= 188 && iRetValue <= 76) { System.out.println("i"); } else if(iVariable >= 189 && iVariable <= 193 && iRetValue <= 80) { System.out.println("i"); } else if (iVariable >= 194 && iVariable <= 198 && iRetValue <= 84) { System.out.println("i"); } /*Button basic_button1 = (Button) findViewById(R.id.button1); basic_button1.setOnClickListener(new View.OnClickListener(this) { public void onClick(View v) { */ } public void onClick(View v) { // TODO Auto-generated method stub } }); } // TODO Auto-generated method stub public void onProgressChanged(SeekBar seekBar, int editText1, boolean fromuser){ text1.setText(editText1 + " " + getString(R.string.seekbar_from_touch)); } public void onStartTrackingTouch(SeekBar seekbar){ //TrackingText.setText(getString(R.string.seekbar_track_on)); } public void onStopTrackingTouch(SeekBar seekbar){ //TrackingText.setText(getString(R.string.seekbar_track_off));
SeekBar basic_seekBar2 = (SeekBar) findViewById(R.id.seekBar2); basic_seekBar2.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { public void onProgressChanged(SeekBar seekBar, int editText2, boolean fromUser) { text2.setText(editText2 + " " + getString(R.string.seekbar_from_touch)); } public void onStartTrackingTouch(SeekBar seekBar) {} public void onStopTrackingTouch(SeekBar seekBar) {} });}}
저희가 짠코드인데요 키와 몸무게를 받아서 다음 클래스로 넘어가려는데 안넘어가요 ㅠㅠ 어케 해야하나요?
로그인 유지
package com.suit;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.SeekBar;
import android.widget.EditText;
import android.widget.SeekBar.OnSeekBarChangeListener;
public class bodysize extends Activity implements SeekBar.OnSeekBarChangeListener{
SeekBar mSeekBar;
EditText text1;
EditText text2;
EditText TrackingText;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.bodysize);
mSeekBar = (SeekBar)findViewById(R.id.seekBar1);
mSeekBar.setOnSeekBarChangeListener(this);
text1 = (EditText)findViewById(R.id.editText1);
TrackingText =(EditText)findViewById(R.id.editText1);
mSeekBar = (SeekBar)findViewById(R.id.seekBar2);
mSeekBar.setOnSeekBarChangeListener(this);
text2 = (EditText)findViewById(R.id.editText2);
TrackingText =(EditText)findViewById(R.id.editText2);
Button basic_button1 = (Button) findViewById(R.id.button1);
basic_button1.setOnClickListener(new View.OnClickListener() {
//public void onClick(View v) {
//Toast.makeText(testview.this, "ImageButton02 clicked", Toast.LENGTH_SHORT).show();
//startActivity(new Intent(getApplicationContext(), bodysizetext.class));
public void main(String[] args) throws IOException{
BufferedReader in =new BufferedReader
(new InputStreamReader(System.in));
int iVariable = 0, iRetValue = 0;
//int a, b, c, d, e, f, g, h, i;
//System.out.println("키를 입력하시오");
iVariable = R.id.editText1; //Integer.parseInt(in.readLine());
//System.out.println("몸무게를 입력하시오");
iRetValue = R.id.editText2;
//키작고 마른 체형
if(iVariable >= 160 && iVariable <= 164 && iRetValue >= 64)
{
System.out.println(bodysizetext.class);
//return a;
//startActivity(new Intent(getApplicationContext(), bodysizetext.class));
}
else if (iVariable >= 165 && iVariable <= 169 && iRetValue >= 68)
{
startActivity(new Intent(getApplicationContext(), bodysizetext.class));
}
else if(iVariable >= 170 && iVariable <= 173 && iRetValue >= 72)
{
startActivity(new Intent(getApplicationContext(), bodysizetext.class));
}
//
if(iVariable >= 160 && iVariable <= 164 && iRetValue >= 54 && iRetValue <= 63)
{
startActivity(new Intent(getApplicationContext(), bodysizetext1.class));
}
else if(iVariable >= 165 && iVariable <= 169 && iRetValue >= 58 && iRetValue <= 67)
{
startActivity(new Intent(getApplicationContext(), bodysizetext1.class));
}
else if(iVariable >= 170 && iVariable <= 173 && iRetValue >= 62 && iRetValue <= 71)
{
startActivity(new Intent(getApplicationContext(), bodysizetext1.class));
}
//
if(iVariable >= 160 && iVariable <= 164 && iRetValue <= 53)
{
System.out.println("c");
}
else if(iVariable >= 165 && iVariable <= 169 && iRetValue <= 57)
{
System.out.println("c");
}
else if(iVariable >= 170 && iVariable <= 173 && iRetValue <= 61)
{
System.out.println("c");
}
//
if(iVariable >= 174 && iVariable <= 178 && iRetValue >= 77)
{
System.out.println("d");
}
else if(iVariable >= 174 && iVariable <= 178 && iRetValue >= 68 && iRetValue <= 76)
{
System.out.println("e");
}
else if(iVariable >= 174 && iVariable <= 178 && iRetValue <= 67)
{
System.out.println("f");
}
//
if(iVariable >= 179 && iVariable <= 183 && iRetValue >= 84)
{
System.out.println("g");
}
else if(iVariable >= 184 && iVariable <= 188 && iRetValue >= 88)
{
System.out.println("g");
}
else if(iVariable >= 189 && iVariable <= 193 && iRetValue >= 92)
{
System.out.println("g");
}
else if(iVariable >= 194 && iVariable <= 198 && iRetValue >= 96)
{
System.out.println("g");
}
//
if(iVariable >= 179 && iVariable <= 183 && iRetValue >= 73 && iRetValue <= 83)
{
System.out.println("h");
}
else if(iVariable >= 184 && iVariable <= 188 && iRetValue >= 77 && iRetValue <= 87)
{
System.out.println("h");
}
else if(iVariable >= 189 && iVariable <= 193 && iRetValue >= 81 && iRetValue <= 91)
{
System.out.println("h");
}
else if(iVariable >= 194 && iVariable <= 198 && iRetValue >= 85 && iRetValue <= 95)
{
System.out.println("h");
}
//
if(iVariable >= 179 && iVariable <= 183 && iRetValue <= 72)
{
System.out.println("i");
}
else if(iVariable >= 184 && iVariable <= 188 && iRetValue <= 76)
{
System.out.println("i");
}
else if(iVariable >= 189 && iVariable <= 193 && iRetValue <= 80)
{
System.out.println("i");
}
else if (iVariable >= 194 && iVariable <= 198 && iRetValue <= 84)
{
System.out.println("i");
}
/*Button basic_button1 = (Button) findViewById(R.id.button1);
basic_button1.setOnClickListener(new View.OnClickListener(this) {
public void onClick(View v) {
*/
}
public void onClick(View v) {
// TODO Auto-generated method stub
}
});
}
// TODO Auto-generated method stub
public void onProgressChanged(SeekBar seekBar, int editText1, boolean fromuser){
text1.setText(editText1 + " " + getString(R.string.seekbar_from_touch));
}
public void onStartTrackingTouch(SeekBar seekbar){
//TrackingText.setText(getString(R.string.seekbar_track_on));
}
public void onStopTrackingTouch(SeekBar seekbar){
//TrackingText.setText(getString(R.string.seekbar_track_off));
SeekBar basic_seekBar2 = (SeekBar) findViewById(R.id.seekBar2);
basic_seekBar2.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
public void onProgressChanged(SeekBar seekBar, int editText2, boolean fromUser) {
text2.setText(editText2 + " " + getString(R.string.seekbar_from_touch));
}
public void onStartTrackingTouch(SeekBar seekBar) {}
public void onStopTrackingTouch(SeekBar seekBar) {}
});
}
}
저희가 짠코드인데요 키와 몸무게를 받아서 다음 클래스로 넘어가려는데 안넘어가요 ㅠㅠ 어케 해야하나요?