CountDownTimer tm[];
  for ( int a = 0 ; a < recordCount ; a++){
   c1.moveToNext();
    long time = c1.getLong(7);
   long currenttime = System.currentTimeMillis();
   long ptime = time-currenttime;
   if(time != 0)
   {
    tm[a] = new CountDownTimer(ptime, 1000){

     @Override
     public void onFinish() {
      new AlertDialog.Builder(NormalActivity.this).setTitle("Time Over").setMessage(name+"사용종료")
      .setNeutralButton("OK", new DialogInterface.OnClickListener() {

       @Override
       public void onClick(DialogInterface dialog, int which) {
        // TODO Auto-generated method stub

 

       }
      }).show();
     }

     @Override
     public void onTick(long c) {
      Toast.makeText(NormalActivity.this, c+"", Toast.LENGTH_SHORT).show();

     }

    };
   }

 

이런식으로 배열에서 time변수에 값이 있을때마다, CountDownTimer를 설정해주려고하는데요...

CountDownTimer tm[]; 배열로 선언을 해주어서, for문안에서 반복되면서 배열에있는 timer를 설정해주려합니다...

그런데 여기서 문제가... CountDownTimer tm[]을 null로 초기화를 안해주면.. 에러가나네요 ㅜㅜ

그렇다고 null처리를 해주면 nullpointerror가 나구요 ㅜㅜ