로딩화면이 처음에 시작해서 프로그래스 바가 꽉차고 메인 액티비티가 실행이되요 근데 되자마자 바로 또 로딩 화면이 재시작합니다 ㅠ 그렇게 계속 반복되요 ㅠㅠ 해결방법좀 알려주십사 올려봅니다 ㅠ 지금 3시간동안 고민하고있는데 안되네요 ㅠ  아 그리고 앱 킨상태에서 로딩화면 끝나고 메인떳을때 그상태에서 앱을 끄고나서 다시켰을떄 로딩화면부터 처음부터 다시시작하는법도 알고싶습니다~


Loding.java

=======================================

package js.schoolapp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.widget.ProgressBar;

public class Loding extends Activity{
   
    ProgressBar m_PrograssReceive;
    private int tempCount = 0;
   
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.lodingg);
       
        m_PrograssReceive = (ProgressBar)findViewById(R.id.ID_PGB_RCVPER);
    }
   
    Handler Activityhdlr = new Handler(){
        @Override
        public void handleMessage(Message msg) {
            super.handleMessage(msg);
            if(tempCount >= 150){
                Intent intent = new Intent(Loding.this,SchoolAppActivity.class);
                startActivityForResult(intent,3);
                finish();
            }
           
            else
            {
                tempCount++;
                m_PrograssReceive.incrementProgressBy(1);
                setProgress(m_PrograssReceive.getProgress()*150);
                StartThread();//Activityhdlr.sendEmptyMessageDelayed(0, 20);
            }
        }   
    };
   
    private void StartThread()
    {
        Activityhdlr.sendEmptyMessage(1000);
    }
   
    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
   
    @Override
    protected void onPause() {
        // TODO Auto-generated method stub
        super.onPause();
    }
   
    @Override
    protected void onResume() {
        // TODO Auto-generated method stub
        super.onResume();
        StartThread();
        //timer 실행 예제
    }
   
    @Override
    protected void onStart() {
        super.onStart();
        StartThread();
    }

    @Override
    protected void onStop() {
        // TODO Auto-generated method stub
        super.onStop();
    }
    protected void OnActivityResult(int requestCode,int resultCode,Intent data){
    }  
}

=======================================


SchoolAppActivity.java(main)

=======================================================

package js.schoolapp;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class SchoolAppActivity extends Activity implements android.view.View.OnClickListener{
   
    Button OneButton,TwoButton,ThreeButton,FourButton;
    //static boolean TF=true;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
       
        Loading();
        OneButton = (Button)findViewById(R.id.one);
        TwoButton = (Button)findViewById(R.id.two);
        ThreeButton = (Button)findViewById(R.id.three);
        FourButton = (Button)findViewById(R.id.four);
       
        OneButton.setOnClickListener(this);
        TwoButton.setOnClickListener(this);
        ThreeButton.setOnClickListener(this);
        FourButton.setOnClickListener(this);
    }

    public void onClick(View v) {
       
        Intent intent;
        if(v.getId() == R.id.one)
        {
            intent = new Intent(SchoolAppActivity.this,intro.class);
            startActivity(intent);
        }
        else if(v.getId() == R.id.two)
        {
            intent = new Intent(SchoolAppActivity.this,position.class);
            startActivity(intent);
        }
        else if(v.getId() == R.id.three)
        {
            Uri uri = Uri.parse("http://google.co.kr");
            intent = new Intent(Intent.ACTION_VIEW,uri);
            startActivity(intent);
        }
        else if(v.getId() == R.id.four)
        {
        }
    }   
   
    public void Loading()
    {
        //if(TF==true){
            startActivity(new Intent(this, Loding.class));
            //TF=false;
        //}
    }
}

=======================================