마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

인텐트 관련 질문입니다... [closed]

0 추천

타임피커2개를 사용하여 시간을 계산해서 타이머 쓰는것을 공부중인데요..

인텐트로 인트형 변수를 썻는데.. 받는쪽에서 잘 넘어오질 않네요... ㅠ..

어느부분이 잘못됬는지 조언 부탁드립니다... ㅠ

 

 

public class MainActivity extends Activity {

.....

 

int hm = ((mTime2.getCurrentHour() - mTime.getCurrentHour()) * 60);
int ms = ((mTime2.getCurrentMinute() - mTime.getCurrentMinute() + hm) * 60);
final int milli2 = ms * 1000;
 
Button launch1 = (Button)findViewById(R.id.countbt);
    launch1.setOnClickListener(new View.OnClickListener(){   
   
    public void onClick(View v) {
        // TODO Auto-generated method stub       
        Intent intent1 = new Intent(MainActivity.this, CountTest.class);   
        intent1.putExtra("cmilli", milli2);
        startActivity(intent1);
       }                
      });
}
 
 
--------------------------------------------------
 
public class CountTest extends Activity {
...
Intent intent1 = getIntent();
int cm = intent1.getIntExtra("cmilli", 5);
 
String result = String.format("%d", cm);
Toast.makeText(CountTest.this, result, 0).show();
 
tv = new TextView(this);
this.setContentView(tv);
 
MyCount counter = new MyCount(cm, 1000);
counter.start();
 
}
 
 
public class MyCount extends CountDownTimer{
public MyCount(long millisInFuture, long countDownInterval) {
super(millisInFuture, countDownInterval);

.....

 

 

 

한수부탁드립니다... ㅠ

질문을 종료한 이유: 자체해결했습니다.
moca (500 포인트) 님이 2013년 5월 26일 질문
moca님이 2013년 5월 27일 closed

1개의 답변

+1 추천
LogCat의 에러 메세지들을 부탁드립니다. LogCat의 메세지에 어디 부분이 잘못되었는지 알려주기 때문이죠. ㅎㅎ
두부고기 (3,820 포인트) 님이 2013년 5월 27일 답변
관심 감사합니다. ㅎㅎ 자체해결했어요.. ㅎㅎ ^^;
...