내 응용 프로그램에서 나는 인터넷에서 데이터를 얻을 필요가있다. 그래서 내가 스플래시 화면에서 다시 바닥에있는 방법을 처리하고 스플래시 화면이 사라진 후에해야합니다.안드로이드 데이터 수신
public class Splash_Screen extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash__screen);
ProgressBar p_bar=(ProgressBar)findViewById(R.id.progressBar1);
Thread thread=new Thread(new Runnable() {
@Override
public void run()
{
data_receiver receiver=data_receiver.getInstance();
receiver.access_parser();
}
});
thread.start();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent main_window=new Intent(com.burusoth1990.advertise.Splash_Screen.this,com.burusoth1990.advertise.MainActivity.class);
startActivity(main_window);
}
}, 5000);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_splash__screen, menu);
return true;
}
}
시작 화면의 필요성이 시작 화면 활동을 종료하고 새로운 활동을 개방 한 후 다시 지상에서 작업을해야 오초하지만 receiver.access_parser() 메소드 작동합니다. 이것은 내 코드이지만 오류가 발생합니다. 안드로이드
사용 안드로이드 서비스를 백그라운드 프로세스에 가장 좋은 방법입니다. – Burusothman